# Add paid plans to a Lovable app (TanStack Start, BuildBase sign-in)

One prompt that lets a workspace in a Lovable app pick a plan and unlocks a paid feature by its slug, checked on the server, plus where the keys live.

Lovable can also connect to BuildBase itself while it builds: [Use BuildBase in Lovable](/console/ai-agents/lovable).

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. The server 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 [Lovable guide](https://www.buildbase.app/guides/add-login-teams-and-paid-plans-to-a-lovable-app) sets up. If it signs people in with something else, such as Supabase or Clerk, read [keep your existing sign-in](/sign-in-setup/keep-your-sign-in) first.

> **Note:**

Stripe connected, a feature with the slug `export` and a published plan that includes it ([Set up billing](/billing-setup/overview)). Entitlement checks need `@buildbase/sdk` 1.0.0 or later.

## The prompt

[Open in Lovable](https://lovable.dev/#prompt=This%20app%20signs%20people%20in%20with%20BuildBase%20%28%40buildbase%2Fsdk%29%2C%20set%20up%20as%20https%3A%2F%2Fwww.buildbase.app%2Fguides%2Fadd-login-teams-and-paid-plans-to-a-lovable-app%20shows.%20If%20it%20does%20not%2C%20stop%20and%20tell%20me.%0ARead%20https%3A%2F%2Fdocs.buildbase.app%2Fbilling%2Fentitlements.md%20first%20and%20do%20not%20invent%20endpoints.%20Plans%20and%20prices%20live%20in%20the%20BuildBase%20console%2C%20with%20a%20feature%20whose%20slug%20is%20export.%0A-%20Add%20an%20Upgrade%20button%20that%20calls%20openWorkspaceSettings%28%27subscription%27%29%20from%20useSaaSAuth%28%29.%0A-%20Wrap%20the%20export%20screen%20in%20WhenEntitled%20from%20%40buildbase%2Fsdk%2Freact%2C%20with%20slug%20%22export%22%20and%20an%20upgrade%20card%20as%20its%20fallbackComponent.%0A-%20In%20the%20TanStack%20Start%20server%20route%20that%20runs%20the%20export%2C%20call%20bb%28%29.entitlements.check%28%7B%20workspaceId%2C%20slug%3A%20%27export%27%20%7D%29%20from%20src%2Fserver%2Fbuildbase.ts%20and%20answer%20402%20when%20allowed%20is%20false.%0ADo%20not%20turn%20on%20Lovable%27s%20built-in%20payments%20or%20add%20a%20Stripe%20integration%20of%20your%20own%2C%20and%20do%20not%20store%20the%20plan%20in%20Lovable%20Cloud%20or%20Supabase.%20Never%20store%20card%20data.)

The link opens a new Lovable project with the prompt filled in and not sent. For the app you already have, paste the prompt into that project's chat instead.

```text
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-lovable-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 TanStack Start server route that runs the export, call bb().entitlements.check({ workspaceId, slug: 'export' }) from src/server/buildbase.ts and answer 402 when allowed is false.
Do not turn on Lovable's built-in payments or add a Stripe integration of your own, and do not store the plan in Lovable Cloud or Supabase. Never store card data.
```

## Where the secrets go

Your Stripe keys go into the BuildBase console, under **Billing**, not into Lovable: the app never holds a Stripe key, and card details stay on Stripe's page. `BUILDBASE_CLIENT_SECRET` stays where the guide put it: **More** > **Settings** > **Secrets**, never with a `VITE_` prefix.

## The Lovable trap

Lovable offers payments of its own, and a prompt that says "add payments" can turn them on. Lovable's docs say a project with payments on cannot be forked and has one payment provider. Read the change before you accept it: if it added a Stripe or Paddle setup step, 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 Lovable app](https://www.buildbase.app/guides/add-login-teams-and-paid-plans-to-a-lovable-app)
- [Entitlement checks](/billing/entitlements): limits, quotas and the server check
- [Add BuildBase to Lovable's instructions or skills](/ai-builders/lovable-import)
