Overview

Understand the payment integration in the boilerplate.

AI Boilerplate uses Stripe for subscriptions and one-time credit purchases.

Stripe

Stripe is a global payment gateway suitable for businesses of all sizes. It offers a robust solution for handling payments.

Features

FeatureDescription
SubscriptionsMonthly and yearly billing intervals with trial support.
Plan ChangesUsers can upgrade or downgrade their subscription plan.
CreditsOne-time credit purchases and automatic grants (e.g., trial, renewal).
Customer PortalStripe Customer Portal for subscription management.
InvoicesView and list past invoices.
WebhookAutomatic processing of checkout, subscription, and invoice events.

How It Works

  1. Plans are defined in packages/utils/src/constants/billing.ts.
  2. Plans are pushed to Stripe with pnpm payments:push.
  3. Users subscribe through Stripe Checkout sessions.
  4. Stripe sends webhook events that update the database automatically.
  5. Users manage subscriptions through the Stripe Customer Portal.

Next Steps