Stripe Checkout
Setup for Stripe-hosted Checkout, the webhook, and plan activation.
Backend
Set these variables in backend/.env or backend/.env.production:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
FRONTEND_APP_URL=http://localhost:5173
STRIPE_PRICE_EARLY_ACCESS=price_...
STRIPE_PRICE_FOUNDERS=price_...
STRIPE_PRICE_EARLY_ACCESS and STRIPE_PRICE_FOUNDERS must be real Stripe Price IDs from your Dashboard.
Webhook
Create a Stripe webhook endpoint:
https://your-domain.com/api/stripe/webhook
Subscribe it to these events:
checkout.session.completedcheckout.session.async_payment_succeededcheckout.session.async_payment_failedcheckout.session.expired
Database
Apply the Prisma migration for stripe_checkout_sessions, then regenerate the Prisma client. Follow Database Migrations — the standard Prisma commands do not work against this database.
Frontend flow
- An authenticated user clicks a paid plan.
- The backend creates a Stripe Checkout Session.
- The frontend redirects to Stripe-hosted Checkout.
- Stripe returns the user to
/profile/settings. - The frontend confirms the session, the webhook finalizes access, and the current-plan card updates.
Notes
- Free-plan activation still happens instantly, without Stripe.
- Get Agent routes users to plan selection instead of opening a custom payment form.
- The old Stripe Elements components have been removed.