Overview
Plans are defined once, in packages/contracts/src/billing.ts. The pricing page, the billing page and the API all read the same object, so a plan's name, label and limits change in one place.
Stripe holds the real prices. The server maps each paid plan to one or more Stripe price ids from its environment, and the webhook is the only thing that writes an organisation's subscription.
Describe the plan
Add the plan's id to planIds, and to paidPlanIds if it is charged for. Then give it an entry in plans: a name, a one-line description, the price label shown before Checkout, the trial length and its entitlements.
Entitlements are seats, projects (null means no limit) and a list of features. Server code asks billing.entitlements(organizationId) for them instead of trusting anything the browser sends.
- Add the id to planIds and paidPlanIds
- Add the plan to plans with its entitlements
- Add any new feature id to featureIds
Connect a Stripe price
In Stripe, create a recurring price for the plan. Add a STRIPE_PRICE_ variable for it to the server's environment schema in apps/server/src/config/env.ts and to the example environment files, then return it from planPrices in apps/server/src/modules/billing/config.ts.
A variable can hold several comma-separated prices. Checkout offers the first; the rest keep existing subscribers on the plan when you change its price.
Check it
Forward the webhook with the Stripe CLI, subscribe from an organisation's billing page with a test card and check the plan once the webhook arrives. Tests never call Stripe: they post signed event fixtures to the webhook instead.
0
Plans in the template to start from: Free, Pro and Team.
0
Days of free trial on a paid plan, set per plan.
0
Stripe events the webhook handles, each applied once.







