LogoNEXTDEVKIT Docs

Creem Integration

Complete guide to set up and configure Creem payments in NEXTDEVKIT

🚀 Creem Setup

Creem is a developer-focused payment platform that provides simple and straightforward APIs for handling payments and subscriptions.

1. Create Creem Account

  1. Create a Creem account at creem.io

2. Get API Keys

  1. Go to DevelopersAPI Keys
  2. Copy your API Key (starts with ck_test_ for test mode)
  3. Create a new webhook with the following URL: https://your-domain.com/api/webhooks/creem
  4. Copy your Webhook Secret for webhook verification

Add to your .env file:

CREEM_API_KEY="ck_test_your_api_key"
CREEM_WEBHOOK_SECRET="your_webhook_secret"

3. Create Products

Pro Subscription Product

  1. Go to ProductsAdd product
  2. Name: "Pro Plan"
  3. Type: "Subscription"
  4. Add Monthly product:
    • Price: your monthly price
    • Billing interval: Monthly
    • Copy the Product ID
  5. Add Yearly product:
    • Price: your yearly price
    • Billing interval: Yearly
    • Copy the Product ID

Lifetime Product

  1. Go to ProductsAdd product
  2. Name: "Lifetime Plan"
  3. Type: "Single payment"
  4. Price: your lifetime price
  5. Copy the Product ID

5. Configure Environment Variables

# Creem Configuration
CREEM_API_KEY="ck_test_your_api_key"
CREEM_WEBHOOK_SECRET="your_webhook_secret"

# Product IDs (in Creem, these are product IDs, not price IDs)
NEXT_PUBLIC_PRICE_ID_PRO_MONTHLY="prod_your_monthly_product_id"
NEXT_PUBLIC_PRICE_ID_PRO_YEARLY="prod_your_yearly_product_id"
NEXT_PUBLIC_PRICE_ID_LIFETIME="prod_your_lifetime_product_id"

6. Update Payment Provider Configuration

In src/config/index.ts, set the provider to Creem:

payment: {
  provider: "creem",
  currency: "USD",
  // ... rest of your configuration
  plans: {
    pro: {
      prices: [
					{
						amount: 9.99, // your monthly price
						interval: PlanInterval.MONTH,
						trialPeriodDays: 7, // your trial period days
					},
					{
						amount: 99, // your yearly price
						interval: PlanInterval.YEAR,
						trialPeriodDays: 30, // your trial period days
					},
      ],
    },
  },
}

🧪 Testing with Creem

Test Mode

Creem automatically provides a test environment when toggle the test mode in the dashboard:

  • All transactions are simulated
  • No real money is processed
  • Full webhook functionality available

Test Credit Cards

Use these test cards with Creem:

Card NumberDescription
4242 4242 4242 4242Successful payment

Local Development

For local webhook testing, you can use ngrok:

# Install ngrok
npm install -g ngrok

# Create tunnel to your local server
ngrok http 3000

# Use the ngrok URL in your Creem webhook configuration
# Example: https://abc123.ngrok.io/api/webhooks/creem

🔧 Creem Features

Simple API Design

Creem focuses on developer experience with:

  • Clean REST APIs: Intuitive endpoint structure
  • Comprehensive docs: Clear documentation with examples
  • Fast setup: Get started in minutes, not hours
  • Webhook reliability: Built-in retry mechanisms

Customer Portal

Creem provides a customer portal where customers can:

  • View purchase history
  • Manage subscriptions
  • Update payment methods
  • Download receipts

Key Advantages

  • Lower fees: Competitive transaction rates
  • Global coverage: Accept payments worldwide
  • Modern interface: Clean, intuitive dashboard
  • Developer-first: Built by developers, for developers

🔄 Webhook Events

Creem sends these webhook events to your application:

Checkout Events

  • checkout.completed: One-time payment completed successfully

Subscription Events

  • subscription.active: Subscription is active and billing
  • subscription.trialing: Subscription is in trial period
  • subscription.canceled: Subscription was canceled
  • subscription.expired: Subscription expired due to failed payments

📊 Creem Dashboard

The Creem Dashboard provides:

  • Transaction overview: Real-time payment tracking
  • Customer management: Customer profiles and history
  • Product catalog: Manage your products and pricing
  • Analytics: Revenue and conversion metrics
  • Webhook monitoring: Track webhook delivery status

🔗 Creem Resources


🎯 Next Steps

Now that Creem is configured: