© 2026 Hedgehog Software, LLC
http://localhost:3000/api/auth/subscription/upgrade
await authClient.subscription.upgrade({ plan: //plan, successUrl: "/", cancelUrl: "/", });
http://localhost:3000/api/auth/stripe/webhook
import { stripe } from "@better-auth/stripe"; import Stripe from "stripe"; const stripeClient = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: "2025-02-24.acacia", //i tried using stripe 17.7 and latest version }); export const auth = betterAuth({ ... //other stuff plugins: [ stripe({ stripeClient, stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!, createCustomerOnSignUp: true, subscriptions: { enabled: true, plans: [] ] });
import { createAuthClient } from "better-auth/react"; import { stripeClient } from "@better-auth/stripe/client" export const authClient = createAuthClient({ baseURL: process.env.BETTER_AUTH_URL, plugins: [ stripeClient({ subscription: true }) ] });