How Cascade handles payments and billing.
New Product
button.
Choose Subscription and select $9.99 as the price for collection every month.
Yearly
& Monthly
and set the price to 9 & 100 respectively.
.env
file add the following:
http://localhost:3000/ls-setup
SUPER_ADMIN
role.npx localtunnel --port 3000 --subdomain cascade
with replacing cascade with your domain. This will make sure we are able to receive webhooks from Lemon Squeezy locally.
You can now click two buttons to create a webhook and create plans in our database that correspond to Lemon Squeezy subsriptions.
Create webhook
button will create a webhook on Lemon Squeezy side, so we can receive events. This is just a nice utility to setup webhooks without going to Lemon Squeezy dashboard.Sync plans
button will create plans in our database that correspond to Lemon Squeezy subscriptions. This is needed so we can match Lemon Squeezy events to our plans.useGuardedSpendCredits
hook will check if the user has enough credits to spend on the given feature. You need to ensure that you Prisma schema has a field for each feature you want to block.
buttonClicks
field to your Plan
schema & reflect it in your FeatureUsage
schema.
syncPlansFromLemonsqueezyVariants
using this guide you need to
manually input the limits for the features in your Database.FeatureUsage
model in database. This model will be used to track the usage of each feature for each user. Extent it when needed.