LemonSqueezy

SaaSBold comes with LemonSqueezy integration for managing subscriptions. This part of the documentation, will show you how to integrate LemonSqueezy into your SaaS boilerplate.

Note: if you want to use Stripe you can Skip this part. Follow the Stripe integration guide to complete the integration.

Create a Store

To integrate LemonSqueezy first you have to create a Store. Login to your LemonSqueezy account and go to the Dashboard. Click on the three dots and create a Store.

Now that you created the Store, we have the Store ID.

Go to Settings->Stores you will see all the stores there. You can find the store ID next to the Store URL. Copy the Store ID and update the env variable:

LEMON_SQUEEZY_STORE_ID="YOUR_STORE_ID"

Create Products

Now we have to create a product. Go to Products then click on the New Product button.

It will open up a sidebar.

Give your product a name and Create variants for the demo we created three variants.

Now that you created the Product variants, copy all the Variant IDs and update the pricingData.ts file.

You can copy the Variant ID from each of the Variants.

Generate API Key

Now we need the API key. To generate the API Key go to Settings→API→Plus Icon.

Click on the Plus Icon and generate the API key.

After that copy the Key and save it on the env file.

LEMON_SQUEEZY_API_KEY="YOUR_API_KEY"

Webhook Integration

We’ve created the products and generated the API key. Now, we have to integrate Webhook to save the subscription data on the Database.

Go to Settings→Webhook. Click on the Plus Icon, it will open up a sidebar like this:

Add the Webhook URL which is:

yoursite.com/api/lemon-squeezy/webhook

Then add the Signing secret, it could be anything you want. Copy the Secret and update the env file:

LEMON_SQUEEZY_WEBHOOK_SIGNATURE="YOUR_SECRET"

Finally, Select the actions. For now, you can select all. If you want then you can disable the one you don’t later. Click on the Save Webhook Button.

Last updated