Lemon Squeezy is an all-in-one platform for running your SaaS business. It handles payments, subscriptions, global tax compliance, fraud prevention, multi-currency, and more. Here’s how to switch the default payment processor from Stripe to Lemon Squeezy.Documentation Index
Fetch the complete documentation index at: https://docs.zopio.dev/llms.txt
Use this file to discover all available pages before exploring further.
1. Swap out the required dependencies
First, uninstall the existing dependencies from the Payments package…Terminal
Terminal
2. Update the environment variables
Next, update the environment variables across the project, for example:apps/app/.env
STRIPE_SECRET_KEY with LEMON_SQUEEZY_API_KEY in the packages/env/index.ts file.
3. Update the payments client
Initialize the payments client in thepackages/payments/index.ts file with the new API key. Then, export the lemonSqueezySetup function from the file.
packages/payments/index.ts
4. Update the payments webhook handler
Update the webhook handler for Lemon Squeezy:apps/api/app/webhooks/payments/route.ts
5. Use Lemon Squeezy in your app
Finally, use the new payments client in your app.apps/app/app/(authenticated)/page.tsx