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
| Feature | Description |
|---|---|
| Subscriptions | Monthly and yearly billing intervals with trial support. |
| Plan Changes | Users can upgrade or downgrade their subscription plan. |
| Credits | One-time credit purchases and automatic grants (e.g., trial, renewal). |
| Customer Portal | Stripe Customer Portal for subscription management. |
| Invoices | View and list past invoices. |
| Webhook | Automatic processing of checkout, subscription, and invoice events. |
How It Works
- Plans are defined in
packages/utils/src/constants/billing.ts. - Plans are pushed to Stripe with
pnpm payments:push. - Users subscribe through Stripe Checkout sessions.
- Stripe sends webhook events that update the database automatically.
- Users manage subscriptions through the Stripe Customer Portal.
Next Steps
- Configure the payment provider