How to Sell Digital Products from Your Lovable App
Add Lemon Squeezy to your Lovable app to sell digital products, courses, or downloads with zero backend complexity.
Before you start
- ✓A Lovable account with an existing app
- ✓A Lemon Squeezy account with a product created
- ✓Your Lemon Squeezy API key
Step by step
Create a product in Lemon Squeezy
Go to your Lemon Squeezy dashboard and create a product with pricing. Copy the checkout URL.
# Lemon Squeezy → Products → + New Product # Name: Your Product # Price: $49 (one-time) or $19/month # Copy the Checkout URL
Create a sales page
Ask Lovable to build a product landing page with a buy button.
Paste this into Lovable:
Create a product sales page with: 1. A hero section with product name, tagline, and price 2. Feature list with icons 3. Social proof section with testimonials 4. A large 'Buy Now — $49' button that links to the Lemon Squeezy checkout URL 5. A FAQ section 6. Clean, modern design with good typography
Add the checkout overlay
Instead of redirecting, you can embed the Lemon Squeezy checkout as an overlay.
Paste this into Lovable:
Add the Lemon Squeezy JavaScript embed to the app: 1. Add <script src='https://app.lemonsqueezy.com/js/lemon.js' defer></script> to the head 2. Change the Buy button to use class 'lemonsqueezy-button' and set href to the checkout URL 3. This opens the checkout as an overlay without leaving the page
Handle the post-purchase redirect
After purchase, Lemon Squeezy redirects to your success URL. Create that page.
Paste this into Lovable:
Create a /purchase-success page that: 1. Shows a thank you message with confetti animation 2. Provides a download link or access instructions 3. Has a button to go to the dashboard 4. Looks celebratory and on-brand
Set up the webhook for delivery
Use Lemon Squeezy webhooks to grant access or deliver files after purchase.
Paste this into Lovable:
Create a Supabase Edge Function called 'lemon-webhook' that: 1. Receives Lemon Squeezy webhook events 2. On 'order_created' event, extracts the customer email 3. Grants the user access in the database (set has_purchased = true) 4. Returns 200 to acknowledge
Common errors
Checkout overlay doesn't appear
The Lemon Squeezy JavaScript didn't load.
Fix: Make sure the script tag has 'defer' attribute and is in the document head, not the body.
Webhook not firing
Lemon Squeezy isn't sending events to your endpoint.
Fix: Go to Lemon Squeezy → Settings → Webhooks and add your Edge Function URL. Make sure it's a public HTTPS URL.
Purchase not reflected in app
The webhook handler isn't matching users correctly.
Fix: Match by email address from the Lemon Squeezy event, not by user ID.