I want to create a subscription with free trial with stripe

Do I need to use the better-auth stripe plugin for this or the stripe sdk? It seems that when I do:

const subscription = await auth.api.upgradeSubscription({
body: {
plan: "Starter Monthly",
successUrl: process.env.NEXT_PUBLIC_URL,
cancelUrl: process.env.NEXT_PUBLIC_URL,
},
headers: ctx.headers,
});

it gives me an error.
Was this page helpful?