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