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
Remove the Stripe webhook handler from the API package…Terminal
apps/api/app/webhooks/lemon-squeezy/route.ts
Webhooks Overview
Learn how to handle webhooks from Lemon Squeezy
Signing Requests
Learn how to verify webhooks from Lemon Squeezy
5. Use Lemon Squeezy in your app
Finally, use the new payments client in your app.apps/app/app/(authenticated)/page.tsx