LemonSqueezy is often the easiest hosted product flow for simple digital
products because it is very product/variant oriented out of the box.
What You Are Setting Up
For LemonSqueezy, you need:- products and variants
- checkout URLs for the app buttons
- a webhook endpoint
- a variant-to-purchase-type mapping
Required Env Vars
Step 1: Create Your Products And Variants
In LemonSqueezy:- Create the products you want to sell
- Create variants if needed
- Decide which variants represent:
- Premium
- Enterprise
- Agency
- Small credits
- Large credits
Step 2: Create Your Checkout Links
Create the hosted checkout links you want your users to visit. Then paste those URLs into.env.local, for example:
Step 3: Map LemonSqueezy Variants To Repo Purchase Types
The repo resolves LemonSqueezy purchases by variant ID. Example:Step 4: Add The Webhook
In LemonSqueezy:- Open your webhook settings
- Add this endpoint:
- Copy the webhook secret into:
How The Repo Processes A Successful LemonSqueezy Payment
Once LemonSqueezy sends a paid order webhook:- the repo verifies the webhook signature
- it reads the variant ID
- it maps that variant to a purchase type
- it stores the purchase in the database
- it updates credits or purchase state
Verification Checklist
Your LemonSqueezy setup is working if:- the app opens the LemonSqueezy checkout page
- LemonSqueezy shows a successful webhook delivery
- a row appears in
purchases - credits or plan state update correctly
Common LemonSqueezy Mistakes
- creating the product but never saving the checkout URL in env
- forgetting the webhook secret
- using the wrong variant ID in
LEMON_SQUEEZY_VARIANT_MAP - testing locally but leaving the webhook pointed at production
Payments Overview
Go back to the shared payment architecture and basics.

