Installation
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 immediatelyproration-charge: Calculate proration and charge at next billing cycleproration-none: No proration, just switch the plan
Licenses
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.