Netcraft

// From Lovable, Bolt or Replit to production

How do you add Stripe payments to a Lovable app?

Lovable offers two paths: built-in payments, where Lovable sets up Paddle or Stripe for you (paid plan required), or your own Stripe account connected with a restricted key. The own-account setup checks subscription status with Stripe at sign-in and has webhooks off by default. For production, add a verified webhook that writes each user's access to your database.

Want it done for you? Vibe-code to Production: from €1,500, fixed quote in 24h →

Gabriel Cazaciuc

By , Founder & lead developer, Netcraft Digital

Last updated

Key facts

Own Stripe account in Lovable
Webhooks off by default; status checked with Stripe at sign-in
Source: Lovable docs, Nov 2026
Subscription matching
Subscriptions are matched to users by email address
Source: Lovable docs, Nov 2026
Built-in payments via Paddle
5.0% + 50¢ per transaction, Paddle is merchant of record
Source: Lovable docs, Nov 2026
Stripe webhook delivery
Retried for up to 3 days in live mode; no order guarantee
Source: Stripe docs, Nov 2026
Stripe setup with us
Included in the Production tier, from €3,000
Source: Our fixed-price offer, Nov 2026

Which Stripe option should I choose in Lovable?

Choose built-in payments if you want Lovable to handle the provider account and taxes; choose your own Stripe account if you want the customer and payment data in an account you control and plan to move the app off Lovable later. A project can use one or the other, not both.

Built-in paymentsYour own Stripe account
Who creates the provider accountLovable (Paddle or Stripe)You
Lovable planPaid plan requiredWorks on the Free plan
KeysNone to handleRestricted key (rk_…) stored as STRIPE_SECRET_KEY
FeesPaddle 5.0% + 50¢; Stripe at standard rates; no Lovable feeStandard Stripe rates
Tax handlingPaddle is merchant of record; Stripe Managed Payments on by default where eligibleYours to set up (Stripe Tax or your accountant)
Test environmentSeparate test and live environmentsThe preview has no separate test environment
Switching provider laterExisting subscriptions do not migrateAlready in your account

The last row is the one to think about early. If you start on built-in payments with Paddle and later want your own Stripe account, existing subscribers do not move with you; they have to subscribe again.

Is Lovable's default Stripe setup enough for production?

It works for a first version, with limits you should know. Without webhooks, the app asks Stripe whether the user has an active subscription when they sign in and use the app, and it matches the subscription to the user by email address.

  • Email mismatch: if a user pays with a different email in Checkout, or changes their email in your app, the subscription is not found and a paying customer loses access.
  • No record in your database: you cannot list paying users, build an admin view or send a “payment failed” email without asking Stripe each time.
  • Events between sign-ins are missed: a refund, a dispute or a failed renewal changes nothing in the app until the next check.
  • Preview with a live key is real money: Lovable's docs warn that payments made from the preview with a live key are real charges.

What does a production Stripe setup look like?

The browser starts Checkout, Stripe sends a webhook to your server, and your server writes the result to a table the user can read but not change. Access in the app comes only from that table.

Stripe webhook checklist

  • Store stripe_customer_id on the user when the first Checkout session is created, and match by that ID instead of email
  • Pass the user's ID as client_reference_id or metadata on the Checkout session
  • Verify the Stripe-Signature header against the raw request body with the endpoint's whsec_ secret
  • Save each processed event ID and skip IDs you have already seen
  • Handle checkout.session.completed, customer.subscription.updated, customer.subscription.deleted and invoice.payment_failed
  • Do not depend on event order; when in doubt, fetch the subscription from Stripe and store its current state
  • Return a 2xx response quickly and do slow work after
  • Give users select-only access to the subscriptions table; only the webhook writes to it

In a Supabase edge function (Deno), the signature check needs the raw text body and the async crypto provider:

const body = await req.text(); // raw body, not req.json()
const signature = req.headers.get("Stripe-Signature")!;
const event = await stripe.webhooks.constructEventAsync(
  body,
  signature,
  Deno.env.get("STRIPE_WEBHOOK_SECRET")!,
  undefined,
  Stripe.createSubtleCryptoProvider(),
);

And the table the app reads access from, writable only by the webhook (which uses the secret key):

create table public.subscriptions (
  user_id uuid primary key references auth.users(id),
  stripe_customer_id text unique not null,
  stripe_subscription_id text unique,
  status text not null,
  current_period_end timestamptz
);

alter table public.subscriptions enable row level security;

create policy "read own subscription" on public.subscriptions
  for select to authenticated
  using ((select auth.uid()) = user_id);
-- no insert/update/delete policies: users cannot write here

The common mistake we look for is a plan or is_paid column on the user's own profile row, which the profile policy lets the user update. More on that in the Lovable + Supabase security checklist.

Why do Stripe webhooks need duplicate protection?

Because Stripe may deliver the same event more than once, retries failed deliveries for up to three days in live mode, and does not guarantee order. A handler that grants credits or sends an invoice on every delivery will sometimes do it twice.

What should happen when a renewal fails or a user cancels?

Access should follow the subscription status Stripe sends, not the date of the last payment. Decide the rules before launch, then make the webhook apply them.

EventWhat the app should do
invoice.payment_failedKeep access during Stripe's retry period, show a banner, and email the user a link to update the card
customer.subscription.updated with status past_due or unpaidLimit access to read-only or the free plan, as your terms say
customer.subscription.updated with cancel_at_period_endKeep access until current_period_end, then downgrade
customer.subscription.deletedRemove paid access and keep the user's data
charge.refunded or charge.dispute.createdFlag the account for review; decide case by case

Without these rules, the usual outcome is one of two mistakes: paying users locked out after a card update, or cancelled users keeping access for months. If you want this built and tested in your repo, a Lovable developer can do it in a few days.

How do I test Stripe in a Lovable app?

Use a test key (rk_test_… or sk_test_…) and the card 4242 4242 4242 4242 with any future date and any CVC. Stripe integration works in the deployed version, not in the preview, and the customer portal does not open inside the preview panel. For webhooks, the Stripe CLI can forward events to a local function (stripe listen --forward-to) and send test events (stripe trigger).

Test before switching to live keys

  • Successful payment grants access, once
  • Opening the success URL without paying grants nothing
  • A cancelled subscription removes access at the end of the period
  • A failed renewal (card 4000 0000 0000 0341) is recorded and the user is told
  • A refund or dispute is reflected in your table
  • Re-sending the same event from the Stripe dashboard changes nothing

Plans, trials and coupons are covered in Stripe subscriptions for an MVP. Payments are one of five areas on the production checklist for AI-built apps, and the full prices are on our pricing page.

// FAQ

Frequently asked questions

Another question? Write to us; you get an answer from the developer within one working day.

Can Lovable integrate with Stripe?

Yes, in two ways: built-in payments, where Lovable sets up Paddle or Stripe for you on a paid plan, or your own Stripe account connected with a restricted API key, which also works on the Free plan.

Does Lovable's Stripe integration use webhooks?

Not by default. The app checks subscription status with Stripe when users sign in; Lovable can write an optional webhook function, which you finish setting up in the Stripe dashboard.

Should I paste my Stripe secret key in the Lovable chat?

No. Lovable's docs say never to paste the key as a chat message; use the Connect Stripe form, preferably with a restricted key.

Why does Stripe work in the published app but not in the preview?

Lovable's Stripe integration works in deployed versions, and the customer portal does not open inside the preview panel. Test on the published URL with test keys.

Can I move from Lovable's built-in payments to my own Stripe account later?

You can switch, but existing subscriptions, products and prices do not migrate. Decide before your first paying customers if you can.

// From Lovable, Bolt or Replit to production

Keep reading

// From Lovable, Bolt or Replit to production

How do you secure the Supabase database behind a Lovable app?

Enable row-level security (RLS) on every table in the public schema, write policies that compare (select auth.uid()) with the row owner for reads and writes, keep the secret key out of the browser, make private storage buckets private, and check who calls each edge function. Lovable's pre-publish scan flags missing RLS, but it cannot prove your policies are correct.

Read the guide

// From Lovable, Bolt or Replit to production

What are the security risks of vibe coding, and how do you check for them?

The main risks in vibe-coded apps are database tables readable with the public key, secret API keys in the browser, permissions checked only in the interface, payments granted by the client, AI endpoints anyone can call, and unreviewed packages. AI tools build what works when you click through it, not what an attacker would try. Each has a quick test.

Read the guide

// From Lovable, Bolt or Replit to production

How do you move a Lovable app to your own hosting and GitHub?

Connect the project to GitHub (two-way sync, all Lovable plans), check package.json for React + Vite or TanStack Start, and deploy the repo to Vercel or Netlify with the same environment variables. Then move the backend to your own Supabase project: schema from migrations, data and users from a database export, files from storage, secrets re-added by hand.

Read the guide

// Start here

How do you take a Lovable, Bolt or Replit app to production?

To take an AI-built app to production you need five things the builder rarely finishes: database access rules on every table, payments confirmed on the server, hosting and a database in your own name, pages Google can read, and code you can change without breaking it. With a developer this usually takes 3–7 days and costs €1,500–3,000.

Read the guide

Vibe-code to Production, at a fixed price

Security, payments, hosting, domain and SEO for apps made with AI builders. From €1,500, 3–7 days. Written scope and price within 24 hours.