Making money
Stripe Payments
Charge users in AI-generated apps with your own Stripe account - keys stay server-side, fulfillment is webhook-verified
1What this gives your app#
Lets apps you generate charge real money - paywalls, 'Pro' upgrades, buy buttons - through Stripe Checkout.
It's YOUR Stripe account: your keys, your money, paid straight to you. Appwright takes no cut and no payment liability (no Stripe Connect). You connect Stripe ONCE in Settings; every app you generate reuses it - you only describe what to sell, never re-enter keys.
The AI writes all the payment code. Your secret key never ships inside the app - it lives in your Supabase backend.
2First connect Supabase (required)#
Stripe payments need a secure server to hold your secret key and to confirm payments - that server is your Supabase project. So connect and enable Supabase first (Settings → BACKEND - SUPABASE).
If Supabase isn't active you'll see 'Stripe keys saved, but payments also need Supabase active'. Appwright pushes your Stripe secret into your Supabase functions automatically on deploy - it's never put in the generated app.
3Get your Stripe keys (start in test)#
On a computer:
- Open the Stripe Dashboard and stay in test mode / a sandbox while you build (Stripe now calls the test environment a 'sandbox'; older accounts show a Test/Live toggle). No real charges happen here.
- Go to Developers → API keys.
- Copy the 'Publishable key' (starts with pk_test_…) and reveal + copy the 'Secret key' (starts with sk_test_…).
Use the standard Secret key (sk_…), not a Restricted key (rk_…) - Appwright validates and pushes the sk_ secret. No merchant approval is needed to build and test the whole flow before activating live payments.
4Connect Stripe in Appwright#
Open AI Studio → Settings → scroll to 'PAYMENTS - STRIPE (OPTIONAL)' → 'CONNECT STRIPE (YOUR ACCOUNT)':
- Leave 'Live mode' OFF for now (off = Test).
- Paste your publishable key into the pk_test_… field.
- Paste your secret key into the sk_test_… field (kept encrypted on this device).
- Turn ON 'Enable Stripe payments for generated apps'.
- Tap 'Validate & save Stripe keys'. Appwright checks the format, makes sure both keys are the same mode, and verifies the secret with Stripe. On success you'll see '● Connected (TEST)'.
5What Appwright wires up for you#
When you generate an app with payments, Appwright does the plumbing automatically - you don't touch Supabase or Stripe dashboards:
- Pushes your STRIPE_SECRET_KEY into your Supabase Edge Functions (encrypted, server-side only).
- Deploys a 'create-checkout' function (starts a Stripe Checkout session) and a 'stripe-webhook' function (confirms payments).
- Registers the webhook with Stripe and stores its signing secret.
- Creates an 'entitlements' table so the app knows who paid.
The publishable key (pk_) is the only Stripe value that ships in the app - that key is safe to be public.
6Describe your paywall - the AI builds it#
Just say what you want in plain English. The AI adds the buy button, the checkout call, and gates the paid features for you:
- 'Charge $5 one-time to unlock the Pro theme.'
- 'A $9/month subscription that removes ads.'
- 'Sell a downloadable PDF for $19.'
You never paste keys or prices into the chat as config - only the intent. Access is unlocked only after Stripe confirms the payment via the webhook, never from a client-side 'paid' flag, so it can't be faked.
7Test a payment end-to-end#
While in Test mode, no real money moves. Run the full flow:
- Open your app and tap the buy/upgrade button.
- On the Stripe Checkout page, pay with the test card:
4242 4242 4242 4242, any future expiry, any CVC, any ZIP.
- You're returned to the app and the paid feature unlocks.
- Check Stripe Dashboard (Test mode) → Payments - you'll see the test charge.
If it unlocks, your webhook + entitlements are wired correctly.
4242 4242 4242 4242 exp: any future date CVC: any 3 digits8Go Live when you're ready#
- Activate your Stripe account for live payments (Stripe Dashboard → 'Activate' / complete business details).
- In Stripe, switch from sandbox/test to live mode and copy your LIVE keys (pk_live_… and sk_live_…) from Developers → API keys.
- In Appwright → Settings → Payments: turn ON 'Live mode', paste the pk_live_/sk_live_ keys, and tap 'Validate & save'. The badge turns to '● Connected (LIVE)'.
- Rebuild your app.
Appwright blocks mixing test and live keys, and switching mode re-points the deployed secret - test and live never coexist on one app, so you can't accidentally ship test keys.
9If something doesn't work#
- 'Stripe keys saved, but payments also need Supabase active' → enable Supabase first (step 2).
- 'You selected TEST but the keys are LIVE' (or vice-versa) → the mode toggle must match your keys' prefix (pk_test/sk_test vs pk_live/sk_live).
- 'Stripe rejected the key' → the secret key is wrong or revoked. Re-copy it from Developers → API keys.
- Payment succeeds but the feature stays locked → the webhook didn't reach Supabase. Rebuild/redeploy so Appwright re-registers the webhook, and confirm the app's Supabase project is the one you connected.
- Can't activate a live account → Stripe does NOT onboard merchants in some countries (including India). Test mode still works everywhere for building; for live payments there you'd need a Stripe-supported country or a different provider.