Hyperlaunch

Lemonsqueezy

Overview

HyperLaunch payments are powered by Lemonsqueezy. Unlike Stripe or other payment systems, LemonSqueezy is a merchant of record, which means it takes on the legal and financial responsibilities of selling products online on behalf of another business. For your SaaS, it means you don't need to worry about collecting taxes, processing refunds, or handling disputes.

Getting Started

Go to Lemonsqueezy and create an account. Name your store, choose your store URL and country.

If you want to collect actual payments, you will need to verify your store. This typically implies sending a live version of your SaaS to the Lemonsqueezy Team, and adding some business information. However, you can start using the demo mode right away. As soon as your MVP is ready, take a short video of your product, even if you feel it does not really make sense, and verify your store on the Lemonsqueezy dashboard. The LemonSqueezy team will follow up with an email. You can quickly describe your SaaS and include that video as well as social media links (the video really speeds up the process).

With your new store ready, go to https://app.lemonsqueezy.com/settings/stores and grab your store ID Fill up the .env.local, don't include the #

# .env.local
LEMONSQUEEZY_STORE_ID=123

You'll also need to create an API key under settings/api, and add it to your .env.local

# .env.local
LEMONSQUEEZY_API_KEY=API_KEY

Product Configuration

Whether you choose subscriptions, one-time products, or both, you'll need to:

  • Create a product (subscription or one-time payment)
  • Create a variant for that product, even if you sell only one variant

Go ahead and create a new product or subscription. Both your product and variant name will be displayed on the checkout, so you can name your product smartly eg: Hyperlaunch (product name) - Pro Plan (Variant name)

Choose subscription for the pricing type if that's what you're aiming for, standard pricing, define a payment interval and price. The subscription product or regular product are actually not the ones that will be used in your app; for that, we will need to create variants.

For example, if you wish to offer 2 plans, you'll need to create 2 variants (eg: Starter & Pro). Your subscription object will point to those variants, allowing the user to upgrade their plan if needed.

Remember that if you have a single option for your subscription, you will still need to create a variant for it

For one-time payments, you will also always need to create a variant, even if your product only has one. You can either create multiple variants (An AI SaaS selling 10, 20, 100 credits) or many products that each have a single variant (course 1, course 2).

With our variants created, we are almost finished with the setup!

Local Development Setup

To test webhooks locally, you'll need to set up a secure tunnel since webhooks require an HTTPS endpoint, while your development server runs on http://localhost:3000.

You'll need to create a tunnel - an HTTPS URL that will redirect requests to your localhost:3000.

There are many free services allowing you to do that, for example, Cloudflare or ngrok. I personally use ngrok; you'll need to install the CLI tool based on the operating system you're using (free). Once you've installed and authenticated the tool, make sure to select the static domain option. We don't want our endpoint to change every time we launch ngrok. You can now fill up the

# .env.local
LEMONSQUEEZY_WEBHOOK_URL=https://some-random-words.ngrok-free.app

Launch your ngrok server by running ngrok http --url=your-random-words.ngrok-free.app 3000. Keep in mind that every time you want to work on your app, you'll need to have that ngrok tunnel running as well as the usual pnpm run dev.

Important Notes

Subscription plans and one-time payments are handled differently in HyperLaunch:

  • Plans refer to products with recurring payments. When a user subscribes, a subscription object is created.
  • One-time payments are stored in the product table. When a user purchases a product, it's saved under purchases in the DB.

NOTE: Remember to always create at least one variant for every product or subscription.

With your product or/and subscription created, your API key pasted, and your ngrok tunnel running, you are ready to visit the setup page!

On this page