LemonSqueezy Integration
Learn how to set up LemonSqueezy payments in your Indie Kit application
LemonSqueezy Integration 🍋
Let's set up LemonSqueezy payments for your Indie Kit application! 🚀
Initial Setup ⚡
-
Create a LemonSqueezy account
-
Set up your store details
-
Add these environment variables to your
.env
file:🔒 Security Note: Never commit these keys to your repository. In production, add them securely to your hosting platform's environment variables.
Product Configuration 🛍️
In your LemonSqueezy Dashboard:
-
Create Products with variants:
- Monthly subscriptions
- Yearly subscriptions
- One-time payments
-
For each product:
- Set up pricing
- Configure billing cycles
- Add product descriptions
- Set up trial periods (if needed)
Webhook Setup 🔌
-
Add your webhook endpoint in LemonSqueezy Dashboard:
-
Enable these webhook events:
subscription_created
subscription_updated
subscription_cancelled
subscription_resumed
order_created
Plan Mapping 🗺️
- Go to your super admin dashboard:
/super-admin/plans
- For each plan, add the corresponding LemonSqueezy Product IDs:
monthlyLemonSqueezyProductId
yearlyLemonSqueezyProductId
onetimeLemonSqueezyProductId
💡 Tip: Find Product IDs in LemonSqueezy Dashboard under Products → Select Product → Variants
Adding Subscribe Buttons 🔘
Use the getSubscribeUrl
helper to create subscription links:
Features Available 🎯
- 🔄 Automatic plan upgrades/downgrades
- 💳 LemonSqueezy-managed billing
- 🏪 Customer portal access
- ⚡ Webhook handling
- 🔍 Payment tracking
- 📊 Usage monitoring
Best Practices 💡
-
Testing
- Use test mode in LemonSqueezy
- Test all subscription flows
- Verify webhook events
- Test upgrade/downgrade paths
-
Production
- Configure proper webhook security
- Monitor webhook events
- Set up email notifications
- Keep product IDs in sync
-
Customer Experience
- Clear pricing information
- Smooth checkout flow
- Easy access to billing portal
- Clear trial period information
Advantages of LemonSqueezy 🌟
- Simple setup process
- Built-in EU VAT handling
- Modern checkout experience
- Lower transaction fees
- Excellent developer experience
- Quick payouts
Now your Indie Kit application is ready to accept payments and manage subscriptions through LemonSqueezy! 🎉