Live demo — shared accounts, sample data, reset regularly. Don't enter anything real.Get the source

Recipe: Add a pricing plan / tier

Recipe: Add a pricing plan / tier

  1. Create the Stripe Price(s) in the Stripe dashboard (or via API) for the new tier — monthly and/or annual. Note their ids.
  2. Add the tier to the PLANS array in lib/billing/plans.ts:
    {
      id: "startup",              // new PlanId — extend the type too
      name: "Startup",
      description: "...",
      price: { monthly: 99, annual: 990 },
      priceId: {
        monthly: process.env.STRIPE_STARTUP_MONTHLY_PRICE_ID,
        annual: process.env.STRIPE_STARTUP_ANNUAL_PRICE_ID,
      },
      features: ["...", "..."],
    }
  3. Widen the PlanId union type at the top of lib/billing/plans.ts to include the new id.
  4. Add the env vars to .env.example (and your .env) — STRIPE_STARTUP_MONTHLY_PRICE_ID, STRIPE_STARTUP_ANNUAL_PRICE_ID.
  5. That's it — lib/auth.ts builds the Stripe plugin's plan list from PAID_PLANS automatically, and both /pricing and /subscribe render from the same array. No other file needs to change.
  6. Verify: npm run build (confirms the type change compiles), then in the browser check /pricing shows the new card, and test-subscribe to it with stripe listen running locally (see billing.md).

To remove a tier, do the reverse: delete its entry from PLANS, remove its env vars, and archive the Stripe Price in the dashboard (Stripe doesn't allow deleting Prices, only archiving). Existing subscribers on a removed plan keep their subscription row — decide separately how you want to migrate or grandfather them.