Polar.sh
A fast and cost-effective Merchant of Record (MoR) for SaaS businesses, especially optimized for companies serving customers in the United States.
Demo
Setup
Add the following environment variables to your .env file:
Go to the Polar Dashboard → Settings → General → Developers in your Polar account.
Make sure you are on the Polar.sh branch in your project. Create an access key with full permissions and paste it into:
Make sure you are using the Sandbox env for development. For production, switch to Live mode in Polar and repeat the same process.
Configure the webhook endpoint.
In the Polar Dashboard, go to Settings → Webhooks and add a new endpoint with your URL. For example: https://yourdomain/api/auth/polar/webhooks
For local development, you can generate a temporary public URL using:
Use the generated URL as your webhook endpoint in Polar.
Enable the following webhook events:
order.paidsubscription.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.
-
Polar's built-in trial abuse prevention ensures users can only claim a trial once across all plans. You can turn-on the trial abuse prevention by going to Settings → Billing → Subscriptions.
-
Users can upgrade or downgrade their subscriptions directly from within the app.
-
Upgrades & Downgrades are immediate and prorated:
Users are downgraded / upgraded instantly. They are charged the prorated difference for the remainder of the billing period.
Even though multiple subscriptions are handled at the application level, it is strongly recommended to disable the Allow multiple subscriptions option in Polar (Settings → Billing → Subscriptions) to prevent accidental duplicate subscriptions.
-
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.