# Add paid plans to a Replit app (React and Express, BuildBase sign-in)

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

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

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. An Express route 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 [Replit guide](https://www.buildbase.app/guides/add-login-teams-and-paid-plans-to-a-replit-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 Replit](https://replit.com/?stack=Build&prompt=CoCwlgzgBAhgDnKEwHMB204FMD2cA2WUYaUA7mAC4hQBCArmPgCa0wREAUAAgEaMte7LAHoIzANYBKADRIslKPUTsoISpTgQAXCJFkDAOn5NmQjofhwRKRsywQRMZswC0+HChKvKWGAFsIVxg0NzgYMDD8EKDKHGDXACcsAipghCQQHDIIQygASQAzYkVmHAcoNBxKOQg4lVCoX3x8KH8sQwAoACU-ZjUNLV0RMoBjXJNBYUsEEV4mfBIUESw0SipCdrXc-37CsES62EayyuriNAA3VcVV5jgcEkpcqAAFaIxj-rhEsFGKxbXC5NEBEBimNgcKCjHAYHCEOQUaiwKCFPyUejJchZKEQfD0FDEaBYAAeD0SlC6rigAEEXMcoABVOAoRLOIj8DSwkEwRSjGAtaB4VYAdRwiQkEHC-wAygp1mgUBBOAByCD0XgQUa-ODrWEqqSoxI4fxKDgymAwGU0+jUThSKlQEVsxDUIik8mKLXJVbAkWgtAAUTWGywe2Npr4AjMwjEkhEyRgoxq5CoNDxBKgACIPeLKFmvgzlKz2dCYIl+qoqNBCgL8EJRhIAMImh5oG6O-KkN1QQNk5IQaDG21Eai8qCJeifHu5ilyfktKC8XgAMXFnGSAEcHTdQ1tnoZRqDG5wAN7kcWS6VYfLMWr4lDaKAq2eUFVQAC+hsKEfkiWuiRzNG5gdM8hYxGQWCJFAAAsAAMABM2K+nW2RhkSqIChYnQACI4GcijOP0vSpG+0AypQOpEDCaDtsm4pQAxMDQseEg4LajHFAAnux0HZGgcghP0pxVF6cRYj2BAhMCJGLIoOG8jAIF5AAclgAFIOJ1HlsJimGEAA&referrer=docs.buildbase.app)

The link opens Replit Agent with the prompt filled in, for a new app; you still send it yourself. For the app you already have, paste the prompt into Agent's chat in that project 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-replit-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 Express route that runs the export, call bbFor(req).entitlements.check({ workspaceId, slug: 'export' }) from server/buildbase.ts and answer 402 when allowed is false.
Do not add Replit's Stripe connector or a checkout of your own, and do not store the plan in Replit Database. Never store card data.
```

## Where the secrets go

Your Stripe keys go into the BuildBase console, under **Billing**, not into Replit: the app never holds a Stripe key, and card details stay on Stripe's page. `BUILDBASE_CLIENT_SECRET` stays where the guide put it: the Secrets tool, and again in **Production app secrets** under **Publishing**, never with a `VITE_` prefix.

## The Replit trap

Replit has a Stripe connector, and Agent writes a checkout page and a webhook endpoint for it when asked for payments. Two payment setups in one app means two places a plan can live. Read the change before you accept it: if Agent added Stripe keys to Secrets or wrote its own checkout, 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 Replit Agent app](https://www.buildbase.app/guides/add-login-teams-and-paid-plans-to-a-replit-app)
- [Entitlement checks](/billing/entitlements): limits, quotas and the server check
- [Add BuildBase to Replit as a skill](/ai-builders/replit-import)
