creem_io wrapper package is deprecated and no longer receives updates. Existing installations may keep working, but you should migrate maintained code to the official creem TypeScript SDK.
This guide walks through the main code changes for moving an existing creem_io integration to creem.
If you are using the
@creem_io/nextjs or @creem_io/better-auth packages, those are separate
adapter packages and are not the deprecated bare creem_io wrapper.Install the SDK Alongside creem_io
Install the core SDK first and keepcreem_io installed while you migrate. Having both packages available makes it easier to compare the old wrapper behavior with the new SDK calls.
creem_io only after the migrated code compiles, tests pass, and no imports from creem_io remain.
Client Setup
ReplacecreateCreem(...) with the Creem client:
creem_io
creem
API Call Changes
The core SDK is generated from the public OpenAPI schema, so method names and argument shapes are closer to the API.| Area | creem_io wrapper | creem SDK |
|---|---|---|
| Initialize client | createCreem({ apiKey, testMode }) | new Creem({ apiKey, server }) |
| Product get | creem.products.get({ productId }) | creem.products.get(productId) |
| Product search | creem.products.list({ page, limit }) | creem.products.search(page, pageSize) |
| Checkout create | creem.checkouts.create({ ... }) | creem.checkouts.create({ ... }) |
| Customer retrieve | wrapper helper methods | creem.customers.retrieve(customerId, email) |
| Subscription get | creem.subscriptions.get({ subscriptionId }) | creem.subscriptions.get(subscriptionId) |
| Subscription cancel | wrapper helper methods | creem.subscriptions.cancel(subscriptionId, { mode }) |
| Transactions search | wrapper helper methods | creem.transactions.search(customerId, orderId, productId, page, pageSize) |
creem_io
creem
Search and Pagination
Some search/list methods return a paginated result. For a single page, readresult:
Webhooks
The wrapper provided high-level callbacks such asonGrantAccess and onRevokeAccess. The core SDK verifies and parses webhook events, while your application decides which events grant or revoke access.
Verify and Parse Events
constructWebhookEventEntity(...) verifies the signature and returns a generated webhook event type. After checking event.eventType, TypeScript narrows event.object to the matching payload type.
Replace Access Callbacks
creem_io
creem
switch cases.
Metadata
The core SDK exposes metadata on supported entities. Your metadata shape is application-defined, so narrow it in your own code when you need specific keys:Final Cleanup
After the migration is complete, remove the deprecated wrapper package:Migration Checklist
When migrating a codebase, use this checklist:- Install
creemalongsidecreem_iountil the migration is complete. - Replace imports from
creem_iowith imports fromcreem. - Replace
createCreem(...)withnew Creem(...). - Convert
testMode: truetoserver: "test". Production is the SDK default, so noserveroption is required. - Update resource method calls from object-wrapper arguments to the core SDK signatures.
- Replace local webhook HMAC code with
constructWebhookEventEntity(...)orverifyWebhookSignature(...). - Replace
event.type/event.datawebhook usage withevent.eventType/event.object. - Recreate
onGrantAccessandonRevokeAccessbehavior as explicit switch cases over subscription webhook events. - Review pagination responses and unwrap
page.resultwhere only one page is needed. - Run TypeScript after each migration step; generated SDK types should reveal most remaining shape mismatches.
- Remove
creem_ioonly after all imports are gone and tests pass.
Common Follow-ups
- If a webhook payload fails validation, compare the raw payload with the generated webhook event type and confirm the public OpenAPI schema matches production webhook delivery.
- If you return SDK pagination results from a framework action or RPC layer, return
page.resultrather than the iterator object. - If your integration relied heavily on wrapper convenience callbacks and you are using Next.js, consider whether the Next.js adapter is a better fit than the lower-level core SDK.