Documentation

Payments

Checkout, portal management, plan upgrades, and feature gating all flow through the Stripe integration.

Server-side helpers

`src/lib/stripe.ts` bootstraps the SDK only when `STRIPE_SECRET_KEY` exists, so the app still runs without payments. Update `STRIPE_PLANS` to sync pricing details everywhere.

Relevant files

  • src/lib/stripe.ts — Stripe config

Customer experience

Billing UI at `/dashboard/billing` calls `/api/stripe/checkout` and `/api/stripe/portal`. Webhooks keep Prisma in sync, and the `FeatureGate` component nudges users to upgrade.

Relevant files

  • src/app/dashboard/billing/page.tsx — Billing UI
  • src/app/api/stripe/webhook/route.ts — Webhook handler
  • src/components/dashboard/feature-gate.tsx — Feature gate