How to Add Stripe Payments to a No-Code App
Add a working Stripe Checkout flow to a Lovable or Bolt app so you can charge for a product or subscription.
Once your app does something useful, you may want to charge for it. Stripe Checkout is the safest path because Stripe hosts the payment page, so your no-code app never handles raw card data. This guide connects Stripe to a generated app and gets a test payment working end to end.
What you need
- A Stripe account in test mode
- A Lovable or Bolt project with a backend (Supabase Edge Functions or a Node server)
- Your Stripe secret key and publishable key from the Stripe dashboard
- About 25 minutes
Step 1: Create a product and price in Stripe
In the Stripe dashboard, open Products, add your product, and create a price. Copy the price ID (it starts with price_). You will pass this ID to Checkout so Stripe knows what to charge.
Step 2: Store your secret key safely
Never paste your Stripe secret key into front-end code. Put it in your backend environment, for example a Supabase Edge Function secret. In Lovable, ask it to create a secure server function and store the key there.
Step 3: Ask the tool to create a Checkout session
Prompt your no-code tool to add a server function that creates a Stripe Checkout session and a button that calls it. Give it the price ID so it wires the right product.
Add a 'Subscribe' button that calls a secure server function. The function should use the STRIPE_SECRET_KEY secret to create a Stripe Checkout session for price price_1QabcDEfGhIjKlMn and redirect the user to the Checkout URL.Step 4: Verify the generated server function
Open the generated function and confirm it reads the key from the environment, not from a hardcoded string, and that it sets a success and cancel URL back to your app.
import Stripe from "npm:stripe";
const stripe = new Stripe(Deno.env.get("STRIPE_SECRET_KEY")!);
const session = await stripe.checkout.sessions.create({
mode: "subscription",
line_items: [{ price: "price_1QabcDEfGhIjKlMn", quantity: 1 }],
success_url: `${origin}/success`,
cancel_url: `${origin}/pricing`,
});
return new Response(JSON.stringify({ url: session.url }));Step 5: Test the full flow
Click Subscribe in the preview, complete the hosted Checkout with the test card, and confirm you land on the success page. Check the Stripe dashboard to see the test payment recorded.
Result
Your app can now take payments through Stripe's hosted Checkout, with the secret key safely on the server. When you are ready to charge real money, swap the test keys for live keys and create live-mode products.
Watch related tutorials
18:00
22:00
20:00
24:00
05:00
30:00