Files
myeasycms-v2/packages/billing/lemon-squeezy
Giancarlo Buomprisco 5b9285a575 Next.js 15 Update (#26)
* Update Next.js and React versions in all packages
* Replace onRedirect function with next/link in BillingSessionStatus, since it's no longer cached by default
* Remove unused revalidatePath import in billing return page, since it's no longer cached by default
* Add Turbopack module aliases to improve development server speed
* Converted new Dynamic APIs to be Promise-based
* Adjust mobile layout
* Use ENABLE_REACT_COMPILER to enable the React Compiler in Next.js 15
* Report Errors using the new onRequestError hook
2024-10-22 14:39:21 +08:00
..
2024-10-22 14:39:21 +08:00
2024-04-01 21:43:18 +08:00

Billing / Lemon Squeezy - @kit/lemon-squeezy

This package is responsible for handling all billing related operations using Lemon Squeezy.

Please add the following environment variables to your .env.local file during development:

LEMON_SQUEEZY_SECRET_KEY=
LEMON_SQUEEZY_SIGNING_SECRET=
LEMON_SQUEEZY_STORE_ID=

Add the variables to your production environment as well using your CI.

Webhooks

When testing locally, you are required to set up a proxy to your own local server, so you can receive the webhooks from Lemon Squeezy. You can use ngrok for this purpose, or any other similar service (LocalTunnel, Cloudflare Tunnel, Localcan, etc).

Once you have the proxy running, you can add the URL to your Lemon Squeezy account developer account as the Webhooks URL.

Please set your app configuration URL to the following:

NEXT_PUBLIC_SITE_URL=https://<your-proxy-url>

Replace <your-proxy-url> with the URL provided by the proxy service.

Webhook Events

You must point the webhook to the /api/billing/webhook endpoint in your local server.

Please subscribe to the following events:

  • order_created
  • subscription_created
  • subscription_updated
  • subscription_expired