Stripe
The most widely used payment provider by top companies, known for its reliability, advanced features, and competitive pricing.
Demo
Setup
Add the following environment variables to your .env file:
Go to the Stripe Dashboard → Developers → API keys in your Stripe account.
Make sure you are on the Stripe branch in your project. Copy your Secret key and paste it into:
Make sure you are using the Test mode key for development. For production, switch to Live mode in Stripe and repeat the same process using the live secret key.
Configure the webhook endpoint.
In the Stripe Dashboard, go to Developers → Webhooks and add a new endpoint with your URL. For example: https://yourdomain/api/auth/stripe/webhook
For local development, you can generate a temporary public URL using:
Use the generated URL as your webhook endpoint in Stripe.
Enable the following webhook events:
payment_intent.succeededinvoice.paidinvoice.payment_failedcustomer.subscription.deletedcustomer.subscription.updated
After creating the webhook, copy the Signing Secret and paste it into:
Features
-
SaaSkit allows you to easily sell both onetime and subscription plans with beautifully designed pricing cards.
-
SaaSkit has built-in trial abuse prevention ensures users can only claim a trial once across all plans.
-
Users can upgrade or downgrade their subscriptions directly from within the app.
-
Downgrades are scheduled:
Users retain access to their current plan until the end of the billing cycle. The downgraded plan takes effect in the next cycle.
-
Upgrades are immediate and prorated:
Users are upgraded instantly. They are charged the prorated difference for the remainder of the billing period.
-
You can sell one-time credit packs using one-time plans.
Usage
To create a one-time or subscription plan, simply add the configuration below to your plans.ts file.
All other attributes (besides the highlighted ones) are used for UI display purposes only.