Skip to content
Start a projectStart

Payments

Sell a plan with Stripe. Checkout, the customer portal, plans with limits, the webhook and a pricing page, in test mode until launch.

What it adds

  • packages/billing: the plans, what each plan allows, and the Stripe prices. It starts with a free plan of 3 projects and a Pro plan without a limit, at $10 a month or $100 a year. Change them in plans.ts.
  • Stripe Checkout to subscribe, and the customer portal to change or cancel.
  • The webhook at /api/webhooks/stripe, which keeps each subscription in your database.
  • /pricing, with the amounts from plans.ts, and Account → Billing.
  • pnpm stripe:setup, which creates the products and prices in Stripe. Prices are found by lookup key, so the same code runs in test and live mode, and several products can share one Stripe account.
  • Browser tests for the billing flows.

Set it up

Use test mode until launch.

  1. Copy the test secret key into STRIPE_SECRET_KEY.

  2. Create the products and prices:

    pnpm stripe:setup
    
  3. Forward webhooks to the app, and set STRIPE_WEBHOOK_SECRET to the whsec_… it prints:

    stripe listen --forward-to localhost:3000/api/webhooks/stripe
    
  4. Turn on the customer portal in the Stripe dashboard: Settings → Billing → Customer portal.

  5. Try it: Account → Billing → Upgrade, with the card 4242 4242 4242 4242.

Before launch

  • Activate the Stripe account, with the URLs of your terms and privacy policy.
  • In live mode, a restricted rk_live_… key is enough: write on Checkout Sessions, Customers and Billing Portal; read on Prices, Products and Subscriptions. Run pnpm stripe:setup with it.
  • Add the webhook endpoint https://<your domain>/api/webhooks/stripe with the events checkout.session.completed and customer.subscription.*.
  • Decide on taxes with an accountant before you turn on Stripe Tax.
  • Test end to end with a production build: subscribe, cancel in the portal, and a failed payment with the card 4000 0000 0000 0341.

Leave it out or add it later

Leave payments out of --modules to start without billing. With Payments on, the CLI also offers the pricing and paywalls skills for your agent. To add Payments to an existing project, ask your agent to use the add-module skill.

Run one command. The CLI asks the rest, and your agent takes it from there.

pnpm create turbinekit my-app
See the prompt

Paste it into an agent that can run commands, such as Claude Code, Codex or Cursor.

Create a new TurbineKit project with me.

TurbineKit (https://turbinekit.dev) is an open-source Turborepo and Next.js starter. Its CLI, create-turbinekit, needs Node.js 24 and pnpm 10 (run `corepack enable` once).

1. Run `pnpm dlx create-turbinekit --help` to see its options.
2. Ask me its questions one at a time, with their defaults: the folder, the product name, one sentence about the product, the company or legal name, the contact email, the languages and the modules. Skip what I have already told you.
3. The CLI only asks questions in an interactive terminal, so run it with my answers as options and `--yes`. Show me the command before you run it.
4. In the new folder, read AGENTS.md. Then do "1. Minimal setup" in SETUP.md, and tick each box you finish.
5. Tell me the URL of the running app, and which services SETUP.md lists next.

No sign-up, no API keys. Needs Node.js 24 and pnpm 10.