This page is kept as a reference for existing
creem_io integrations.Migrate to the creem SDK
Replace
creem_io imports, update API calls, and move webhook handling to the
typed creem SDK helpers.Overview
The deprecatedcreem_io package is a convenience wrapper around the Creem API that provides:
- Simplified webhook handling with
onGrantAccessandonRevokeAccesscallbacks - Automatic signature verification for webhook events
- Type-safe event handlers for all webhook events
- Framework-agnostic webhook processing
Installation
For existingcreem_io integrations, install with your preferred package manager:
Quick Start
Environment Variables
We recommend storing your credentials in environment variables:API Resources
The SDK organizes all operations into logical resources:Products
Checkouts
Customers
Subscriptions
Update Behavior Options: -
proration-charge-immediately: Calculate
proration and charge immediately - proration-charge: Calculate proration and
charge at next billing cycle - proration-none: No proration, just switch the
planLicenses
Discounts
Transactions
Webhooks
Handle Creem webhook events in your application. The SDK provides automatic signature verification and type-safe event handlers.Basic Webhook Setup
Access Management Callbacks
TheonGrantAccess and onRevokeAccess callbacks simplify subscription access management:
All Available Webhook Events
Framework-Specific Examples
- Next.js App Router
- Express
- Fastify
- Hono
TypeScript Support
The SDK is written in TypeScript and provides comprehensive type definitions:Error Handling
The SDK throws errors when API calls fail. Always wrap SDK calls in try-catch blocks:References
For feedback or issues, open a PR or issue on the Creem SDK GitHub.