logo
SaaSkit
Payments

Creem.io

A modern payment provider with a built-in affiliate system, enabling SaaS businesses to manage subscriptions, one-time payments, and referral programs in one place.

Demo

Setup

Add the following environment variables to your .env file:

# Payment (Creem)
CREEM_API_KEY=
CREEM_WEBHOOK_SECRET=

Go to the Creem Dashboard → Developers → API & Webhooks in your Creem account.

Make sure you are on the Creem branch in your project. Create an api key with full permissions and paste it into:

CREEM_API_KEY=

Make sure you are using the Test mode for development. For production, switch to Live mode in Creem and repeat the same process.

Configure the webhook endpoint.

In the Creem Dashboard, go to Developers → API / Webhooks and add a new endpoint with your URL. For example: https://yourdomain/api/webhook

For local development, you can generate a temporary public URL using:

ngrok http 3000

Use the generated URL as your webhook endpoint in Creem.

Enable the following webhook events:

  • checkout.completed
  • subscription.active
  • subscription.trialing
  • subscription.canceled
  • subscription.scheduled_cancel
  • subscription.paid
  • subscription.expired
  • subscription.unpaid
  • subscription.update
  • subscription.past_due
  • subscription.paused

After creating the webhook, copy the Signing Secret and paste it into:

CREEM_WEBHOOK_SECRET=

Features

  1. SaaSkit allows you to easily sell both onetime and subscription plans with beautifully designed pricing cards.

  2. SaaSkit has built-in trial abuse prevention ensures users can only claim a trial once across all plans. Read more →

  3. Users can upgrade or downgrade their subscriptions directly from within the app.

  4. Downgrades are immediate and free:

    Users are upgraded instantly. They are not charged for the downgraded plan for the remainder of the billing period.

  5. Upgrades are immediate and prorated:

    Users are upgraded instantly. They are charged the prorated difference for the remainder of the billing period.

  6. 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.

export const plans : Plan[] = [
  {
    plan: "onetime plan",
    description: "your plan description",
    planType: "onetime",
    currency: "$",
    variants: [
      {
        productId: "prod_7Yq0jYljHyyZK9hrxH77PH", // creem producId
        amount: 179,
        credit: 1000, // used to grant credits to user
      },
    ],
    features: [
      { name: "feature 1", included: true },
      { name: "feature 2", included: true },
      { name: "feature 3", included: true },
      { name: "feature 4", included: true },
      { name: "feature 5", included: false },
    ],
  },
]

All other attributes (besides the highlighted ones) are used for UI display purposes only.

Trial Abuse Prevention

Due to limitations in the Creem API, trial abuse prevention requires creating two separate products for each subscription plan:

  • One product configured with a trial
  • One product configured without a trial

When a user is eligible for a trial, the product with the trial is used. If the user has already consumed a trial (trial abuse prevention), the system automatically uses the product without a trial.

If you do not want to offer a trial for a specific plan, simply use the same productId for both:

  • productId
  • productIdWithoutTrial

This ensures consistent behavior without requiring additional configuration.

On this page