Add paid plans to a Bolt app (Vite, BuildBase sign-in)
One prompt that lets a workspace in a Bolt.new app pick a plan and unlocks a paid feature by its slug, checked on the server, plus where the keys live.
Bolt can also connect to BuildBase itself while it builds: Use BuildBase in Bolt.
A workspace picks a plan in the SDK's subscription screen, pays on Stripe's page, and the feature its plan includes appears without a reload. A function on your host checks the same answer, so a person cannot reach the feature by typing its address. This page assumes the app already signs people in with @buildbase/sdk, as the Bolt guide sets up. If it signs people in with something else, such as Supabase or Clerk, read keep your existing sign-in first.
Before you start
Stripe connected, a feature with the slug export and a published plan that includes it (Set up billing). Entitlement checks need @buildbase/sdk 1.0.0 or later.
The prompt
Bolt's help center documents no link that opens Bolt with a prompt filled in, so copy this into your project's chat.
This app signs people in with BuildBase (@buildbase/sdk), set up as https://www.buildbase.app/guides/add-login-teams-and-paid-plans-to-a-bolt-app shows. If it does not, stop and tell me.
Read https://docs.buildbase.app/billing/entitlements.md first and do not invent endpoints. Plans and prices live in the BuildBase console, with a feature whose slug is export.
- Add an Upgrade button that calls openWorkspaceSettings('subscription') from useSaaSAuth().
- Wrap the export screen in WhenEntitled from @buildbase/sdk/react, with slug "export" and an upgrade card as its fallbackComponent.
- In the api/ function that runs the export, call bbFor(request).entitlements.check({ workspaceId, slug: 'export' }) from server/buildbase.ts and answer 402 when allowed is false.
Do not turn on Bolt's built-in Stripe payments, and do not store the plan in Bolt Cloud or Supabase. Never store card data.Where the secrets go
Your Stripe keys go into the BuildBase console, under Billing, not into Bolt: the app never holds a Stripe key, and card details stay on Stripe's page. BUILDBASE_CLIENT_SECRET stays where the guide put it: .env while you build (listed in .gitignore), your host's environment variables for the live site, never with a VITE_ prefix.
The Bolt trap
Bolt has a Stripe integration of its own, and its help center says Bolt handles the payment webhooks for it. Two payment setups in one app means two places a plan can live. Read the change before you accept it: if Bolt asked for Stripe keys or added a checkout of its own, undo it and paste the prompt again.
Gate on the slug, not the plan name. A check for "is this the Pro plan" breaks the day you rename a plan or sell the feature as an add-on.
Full guides
- Add login, teams and paid plans to a Bolt.new app
- Entitlement checks: limits, quotas and the server check
- Add BuildBase to Bolt's knowledge or skills