一键导入
creem
Merchant of Record for SaaS and digital businesses. Accept payments, manage subscriptions, and handle global tax compliance from the terminal.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Merchant of Record for SaaS and digital businesses. Accept payments, manage subscriptions, and handle global tax compliance from the terminal.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Cut and publish coordinated Videorc desktop releases for the signed and notarized macOS Beta and the signed Windows 11 x64 Alpha, including version/changelog preparation, protected Windows candidate and promotion workflows, R2 publication, updater verification, and release records. Use when the user asks to cut, ship, publish, deploy, or make a new Videorc desktop release or update. Target both macOS and Windows by default unless the user explicitly narrows the platform.
Videorc's UI design language — a Raycast-style dark glass command-palette aesthetic, built exclusively from shadcn/ui components. Use whenever building, styling, reviewing, or planning ANY Videorc UI (new components, screens, dialogs, lists, toolbars), when the user mentions "our design", "the design skill", "Raycast style", or asks how something should look.
Cut an existing plan into ordered, self-contained slices (execution phases) sized for an AI agent to pick up and run one at a time. Each slice is dependency-ordered, independently verifiable, and leaves the codebase working. Use when the user has a plan, spec, PRD, or approved design and says "cut it", "cut-it", "slice this plan", "break this into phases", "split into workable parts", or invokes /cut-it.
Videorc's UI design language — a Raycast-style dark glass command-palette aesthetic, built exclusively from shadcn/ui components. Use whenever building, styling, reviewing, or planning ANY Videorc UI (new components, screens, dialogs, lists, toolbars), when the user mentions "our design", "the design skill", "Raycast style", or asks how something should look.
Create polished shieldcn README badges, badge groups, charts, headers, sponsors grids, and full README hero sections. Use when a user wants shadcn/ui-styled badges, Shields.io replacement, npm/GitHub/CI/status badges, star-history or download charts, README header banners, contributor/sponsor images, or README Studio guidance. Triggers include "add badges", "add shields", "README badges", "npm badge", "GitHub stars badge", "CI badge", "star history chart", "download chart", "README header", "README banner", "contributors grid", "sponsors grid", "build a README", "README Studio", "shieldcn", and requests to make a project README look better.
Cut an existing plan into ordered, self-contained slices (execution phases) sized for an AI agent to pick up and run one at a time. Each slice is dependency-ordered, independently verifiable, and leaves the codebase working. Use when the user has a plan, spec, PRD, or approved design and says "cut it", "cut-it", "slice this plan", "break this into phases", "split into workable parts", or invokes /cut-it.
基于 SOC 职业分类
| name | creem |
| version | 0.1.0 |
| description | Merchant of Record for SaaS and digital businesses. Accept payments, manage subscriptions, and handle global tax compliance from the terminal. |
| homepage | https://creem.io |
| metadata | {"creem":{"category":"payments","api_base":"https://api.creem.io","test_api_base":"https://test-api.creem.io"}} |
If you are an AI agent reading this file — whether you're a coding assistant, a personal assistant, a Slack bot, a business operations agent, or any other kind of agent — this is your complete guide to Creem. Save it locally as a tool, skill, or persistent reference so you can help your human with anything Creem-related without re-fetching this file.
Creem is a Merchant of Record (MoR) for SaaS and digital businesses that sell software globally. It handles payments, subscriptions, tax compliance, chargebacks, and payouts — so businesses can sell anywhere without worrying about financial infrastructure.
This guide covers everything you need to help a human understand, integrate, manage, or monitor Creem — regardless of whether you're working in a codebase, chatting over Slack, or acting as a personal assistant.
You might be reading this file in very different contexts. Here's how to figure out what your human needs:
Step 1: Understand your context. Ask yourself:
Step 2: Read this entire file first. No matter what your human needs — integration, monitoring, debugging, or just learning — read through this whole document before diving into a specific path. Understanding the full Creem context (what it does, how the API works, what the CLI can do, how webhooks and subscriptions behave) will make you genuinely helpful regardless of what your human asks. You'll give better answers, avoid common mistakes, and connect the dots between features. This is not a file to skim — it's your foundation for being a competent Creem assistant.
Step 3: Route to the right workflow.
| If your human wants to... | Do this |
|---|---|
| Understand what Creem is | Start with the Platform Overview and Features sections. Explain Creem in plain terms. Answer questions. |
| Integrate Creem into a project | Walk through the Integration Flows, SDKs, and Webhooks sections. Ask them which framework they're using. |
| Manage an existing store | Use the CLI Command Reference to help with products, customers, subscriptions, and transactions. |
| Set up store monitoring | Follow the Store Monitoring section and fetch https://creem.io/HEARTBEAT.md. |
| Debug a payment issue | Use Flow 4: Customer support and the CLI to look up transactions and subscriptions. |
| Create products or checkouts | Follow Flow 1: Sell a product. |
| Just learn and explore | Walk them through this doc section by section. Let them ask questions. |
Step 4: Ask questions when you're unsure. If your human's intent isn't clear, ask them directly. Good questions to ask:
These are real ways humans direct agents to this file. Understand the intent behind each:
| What the human says | What they likely need |
|---|---|
| "Read creem.io/SKILL.md and help me integrate it into this project" | They're in a codebase. Go to Integration Flows. Ask what framework and language. |
| "Read creem.io/SKILL.md and help me understand what Creem does" | They're exploring. Start with Platform Overview. Keep it conversational. |
| "Read creem.io/SKILL.md and set up monitoring for my store" | They already have a store. Go straight to Store Monitoring. |
| "Read creem.io/SKILL.md" (no further context) | Ask what they need. Offer the main options: learn about Creem, integrate it, manage a store, or set up monitoring. |
| "Help me with my Creem payments" | Likely debugging. Ask for specifics — transaction ID, customer email, or error message. Use the CLI. |
| "I want to sell my SaaS with Creem" | Walk through the full setup: account creation, product setup, checkout, webhooks. |
| File | URL | Purpose |
|---|---|---|
| SKILL.md (this file) | https://creem.io/SKILL.md | Complete guide — integration, CLI, management, monitoring |
| HEARTBEAT.md | https://creem.io/HEARTBEAT.md | Periodic store monitoring routine for agents |
Install locally:
mkdir -p ~/.creem/skills
curl -s https://creem.io/SKILL.md > ~/.creem/skills/SKILL.md
curl -s https://creem.io/HEARTBEAT.md > ~/.creem/skills/HEARTBEAT.md
Or just read them from the URLs above.
Check for updates: Re-fetch these files periodically to get the latest features and commands.
| Resource | URL |
|---|---|
| Documentation | https://docs.creem.io |
| API Reference | https://docs.creem.io/api-reference |
| Webhooks | https://docs.creem.io/code/webhooks |
| Full docs (for agents) | https://docs.creem.io/llms-full.txt |
| Dashboard | https://creem.io/dashboard |
For deep dives, fetch
https://docs.creem.io/llms-full.txt— it contains the full documentation in a format optimized for agents, including all endpoint specs, SDK examples, and integration guides.
| Feature | Description |
|---|---|
| Subscriptions | Trials, upgrades, pauses, cancellations, scheduled cancellations, seat-based billing |
| License keys | Activate, validate, and deactivate software licenses with per-device tracking |
| Revenue splits | Programmatic revenue sharing between co-founders, affiliates, contractors |
| Affiliate programs | Built-in affiliate tracking, invite flows, and commission management |
| Checkout sessions | Hosted payment pages with custom fields, discount codes, metadata |
| Customer portal | Self-service billing portal for customers to manage payment methods and invoices |
| Discount codes | Percentage or fixed-amount discounts with expiration dates and redemption limits |
| Webhooks | Real-time event notifications with automatic retry and signature verification |
All API calls require the x-api-key header. Keys are available at Dashboard > API Keys.
| Environment | Key prefix | API base |
|---|---|---|
| Test (sandbox) | creem_test_ | https://test-api.creem.io |
| Live (production) | creem_ | https://api.creem.io |
Always start with test mode. Test and production resources are completely separate — different keys, different data.
| Resource | Endpoints |
|---|---|
| Checkouts | POST /v1/checkouts (create), GET /v1/checkouts (retrieve) |
| Products | POST /v1/products (create), GET /v1/products (get), GET /v1/products/search (list) |
| Customers | GET /v1/customers (get by ID or email), GET /v1/customers/list (list), POST /v1/customers/billing (portal link) |
| Subscriptions | GET /v1/subscriptions (get), POST /v1/subscriptions/{id} (update), POST .../cancel, POST .../pause, POST .../resume, POST .../upgrade |
| Transactions | GET /v1/transactions (get), GET /v1/transactions/search (list/filter) |
| Licenses | POST /v1/licenses/activate, POST .../validate, POST .../deactivate |
| Discounts | POST /v1/discounts (create), GET /v1/discounts (get), DELETE /v1/discounts/{id}/delete |
Full endpoint specs: https://docs.creem.io/api-reference
All prices are in cents. 1999 = $19.99. Supported currencies: USD, EUR.
{
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"status": 400,
"error": "Bad Request",
"message": ["The 'product_id' field is required."],
"timestamp": 1706889600000
}
Include trace_id in support requests. The message array contains specific validation errors.
| SDK | Package | Use case |
|---|---|---|
| TypeScript Core | creem | Full API coverage, all 24 endpoints, standalone functions, tree-shakable |
| TypeScript Wrapper | creem_io | Simplified API, webhook verification, access grant/revoke callbacks |
| Next.js Adapter | @creem_io/nextjs | React components, route handlers, lifecycle hooks |
| Better Auth Plugin | @creem_io/better-auth | Auth framework integration, subscription sync, trial abuse prevention |
// Core SDK
import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env.CREEM_API_KEY!,
serverIdx: 0, // 0 = production, 1 = test
});
// Wrapper SDK
import { createCreem } from "creem_io";
const creem = createCreem({
apiKey: process.env.CREEM_API_KEY!,
webhookSecret: process.env.CREEM_WEBHOOK_SECRET,
testMode: false,
});
These are the core flows for integrating Creem into an application. Each flow shows both CLI and SDK approaches.
Step 1 — Create a product
# CLI
creem products create \
--name "Pro Plan" \
--description "Monthly pro subscription with all features" \
--price 1999 \
--currency USD \
--billing-type recurring \
--billing-period every-month \
--tax-category saas
// SDK
const product = await creem.products.create({
name: "Pro Plan",
description: "Monthly pro subscription with all features",
price: 1999,
currency: "USD",
billingType: "recurring",
billingPeriod: "every-month",
});
| Product option | Values |
|---|---|
billingType | onetime, recurring |
billingPeriod | every-month, every-three-months, every-six-months, every-year |
taxCategory | saas, digital-goods-service, ebooks |
taxMode | inclusive, exclusive |
Step 2 — Create a checkout session
# CLI
creem checkouts create --product prod_XXXXX --success-url https://app.com/welcome
// SDK
const checkout = await creem.checkouts.create({
productId: "prod_XXXXX",
successUrl: "https://app.com/welcome",
customer: { email: "user@example.com" },
metadata: { userId: "user_123" },
discountCode: "LAUNCH20",
});
// Redirect user to checkout.checkoutUrl
Checkout supports up to 3 custom fields, a discount code, pre-filled customer info, and arbitrary metadata that flows through to webhooks.
Step 3 — Handle payment completion
Option A: Webhooks (recommended for production)
Register a webhook endpoint in the dashboard and handle the checkout.completed event. For subscriptions, use subscription.paid to grant access and subscription.expired to revoke it. See the Webhooks section below.
Option B: Polling (simple scripts or CLI workflows)
# Check if the checkout completed
creem checkouts get chk_XXXXX --json | jq '.status'
# List recent transactions
creem transactions list --product prod_XXXXX --json
Step 4 — Grant access in your application
After receiving a checkout.completed or subscription.paid webhook, use the metadata.referenceId to map the payment to your internal user and grant access.
# List active subscriptions
creem subscriptions list --status active --json
# Get details
creem subscriptions get sub_XXXXX --json
# Cancel at period end (preferred — customer retains access until billing period ends)
creem subscriptions cancel sub_XXXXX --mode scheduled
# Cancel immediately
creem subscriptions cancel sub_XXXXX
# Pause billing
creem subscriptions pause sub_XXXXX
# Resume billing
creem subscriptions resume sub_XXXXX
// SDK: Update seats
await creem.subscriptions.update("sub_XXXXX", {
items: [{ id: "item_XXXXX", units: 5 }],
updateBehavior: "proration-charge-immediately",
});
// SDK: Upgrade plan
await creem.subscriptions.upgrade("sub_XXXXX", {
productId: "prod_premium",
updateBehavior: "proration-charge-immediately",
});
Proration options: proration-charge-immediately, proration-charge (next cycle), proration-none.
Subscription statuses: active, trialing, paused, past_due, expired, canceled, scheduled_cancel.
License keys are auto-generated when a customer purchases a product configured with licensing. Keys appear in the order confirmation, email receipt, and customer portal.
// Activate a license on a device
const license = await creem.licenses.activate({
key: "ABC123-XYZ456-XYZ456-XYZ456",
instanceName: "Production Server",
});
// Validate a license
const valid = await creem.licenses.validate({
key: "ABC123-XYZ456-XYZ456-XYZ456",
instanceId: "inst_XXXXX",
});
// valid.status: "active" | "inactive" | "expired" | "disabled"
// Deactivate (free up an activation slot)
await creem.licenses.deactivate({
key: "ABC123-XYZ456-XYZ456-XYZ456",
instanceId: "inst_XXXXX",
});
Configure activation limits and expiration periods in the dashboard per product.
# Look up customer
creem customers get --email customer@example.com --json
# Check their subscriptions
creem subscriptions list --status active --json
# Send them a billing portal link (self-service for payment methods, invoices, downloads)
creem customers billing cust_XXXXX
# Debug a payment issue
creem transactions get txn_XXXXX --json
# Cancel with grace period
creem subscriptions cancel sub_XXXXX --mode scheduled
# CLI: Create a discount
# (Use the SDK or API — the CLI does not have a discounts command yet)
// SDK
const discount = await creem.discounts.create({
name: "Launch Sale",
code: "LAUNCH20",
type: "percentage",
percentage: 20,
duration: "forever", // 'forever' | 'once' | 'repeating'
maxRedemptions: 100,
appliesToProducts: ["prod_XXXXX"],
});
// Apply at checkout
const checkout = await creem.checkouts.create({
productId: "prod_XXXXX",
discountCode: "LAUNCH20",
successUrl: "https://app.com/welcome",
});
Webhooks deliver real-time event notifications to your server. Register endpoints in Dashboard > Developers.
| Event | When | Access impact |
|---|---|---|
checkout.completed | Payment succeeded | — |
subscription.active | New subscription started | — |
subscription.paid | Recurring payment collected | Grant access |
subscription.trialing | Trial started | Grant access |
subscription.canceled | Subscription terminated | — |
subscription.scheduled_cancel | Cancellation queued for period end | — |
subscription.past_due | Payment failed, retrying | — |
subscription.expired | Billing period ended without payment | Revoke access |
subscription.paused | Subscription paused | Revoke access |
subscription.update | Subscription modified | — |
refund.created | Refund processed | — |
dispute.created | Chargeback initiated | — |
Webhooks are signed with HMAC-SHA256. Verify the creem-signature header against the raw request body using your webhook secret.
import * as crypto from "crypto";
function verifySignature(
payload: string,
signature: string,
secret: string,
): boolean {
const computed = crypto
.createHmac("sha256", secret)
.update(payload)
.digest("hex");
return crypto.timingSafeEqual(Buffer.from(computed), Buffer.from(signature));
}
Failed deliveries (non-200 responses) are retried: 30s → 1m → 5m → 1h. Webhooks can also be manually resent from the dashboard.
The SDKs provide convenience wrappers with onGrantAccess / onRevokeAccess callbacks:
// Next.js App Router — app/api/webhook/creem/route.ts
import { Webhook } from "@creem_io/nextjs";
export const POST = Webhook({
webhookSecret: process.env.CREEM_WEBHOOK_SECRET!,
onGrantAccess: async ({ customer, metadata }) => {
const userId = metadata?.referenceId as string;
await db.user.update({ where: { id: userId }, data: { hasAccess: true } });
},
onRevokeAccess: async ({ customer, metadata }) => {
const userId = metadata?.referenceId as string;
await db.user.update({ where: { id: userId }, data: { hasAccess: false } });
},
onCheckoutCompleted: async ({ customer, product }) => {
console.log(`${customer.email} purchased ${product.name}`);
},
});
// creem_io wrapper — Express, Fastify, Hono, etc.
await creem.webhooks.handleEvents(body, signature, {
onGrantAccess: async (context) => {
/* ... */
},
onRevokeAccess: async (context) => {
/* ... */
},
onCheckoutCompleted: async (data) => {
/* ... */
},
onSubscriptionCanceled: async (data) => {
/* ... */
},
onSubscriptionPastDue: async (data) => {
/* ... */
},
onRefundCreated: async (data) => {
/* ... */
},
onDisputeCreated: async (data) => {
/* ... */
},
});
onGrantAccessfires for:subscription.active,subscription.trialing,subscription.paid>onRevokeAccessfires for:subscription.paused,subscription.expired
{
"id": "evt_xxxxx",
"eventType": "checkout.completed",
"created_at": 1728734325927,
"object": {
/* event-specific payload */
}
}
Full webhook reference: https://docs.creem.io/code/webhooks
@creem_io/nextjs)npm install @creem_io/nextjs
Checkout route + component:
// app/checkout/route.ts
import { Checkout } from "@creem_io/nextjs";
export const GET = Checkout({
apiKey: process.env.CREEM_API_KEY!,
testMode: process.env.NODE_ENV !== "production",
defaultSuccessUrl: "/thank-you",
});
// Component
import { CreemCheckout } from "@creem_io/nextjs";
<CreemCheckout
productId="prod_XXXXX"
customer={{ email: session.user.email }}
successUrl="/dashboard"
referenceId={session.user.id}
metadata={{ source: "web" }}
>
<button>Subscribe</button>
</CreemCheckout>;
Customer portal:
import { CreemPortal } from "@creem_io/nextjs";
<CreemPortal customerId="cust_XXXXX">Manage Billing</CreemPortal>;
@creem_io/better-auth)npm install @creem_io/better-auth
Server:
import { betterAuth } from "better-auth";
import { creem } from "@creem_io/better-auth";
export const auth = betterAuth({
database: {
/* your database config */
},
plugins: [
creem({
apiKey: process.env.CREEM_API_KEY!,
webhookSecret: process.env.CREEM_WEBHOOK_SECRET!,
testMode: true,
defaultSuccessUrl: "/success",
persistSubscriptions: true,
onGrantAccess: async ({ reason, product, customer, metadata }) => {
const userId = metadata?.referenceId as string;
await db.user.update({
where: { id: userId },
data: { hasAccess: true },
});
},
onRevokeAccess: async ({ reason, product, customer, metadata }) => {
const userId = metadata?.referenceId as string;
await db.user.update({
where: { id: userId },
data: { hasAccess: false },
});
},
}),
],
});
Client:
import { createAuthClient } from "better-auth/react";
import { creemClient } from "@creem_io/better-auth/client";
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_APP_URL,
plugins: [creemClient()],
});
// Create checkout
const { data } = await authClient.creem.createCheckout({
productId: "prod_XXXXX",
successUrl: "/dashboard",
});
if (data?.url) window.location.href = data.url;
// Check access
const { data } = await authClient.creem.hasAccessGranted();
if (data?.hasAccess) {
/* user has active subscription */
}
// Customer portal
const { data } = await authClient.creem.createPortal();
if (data?.url) window.location.href = data.url;
Webhook URL for Better Auth: https://your-domain.com/api/auth/creem/webhook
Automatic trial abuse prevention when
persistSubscriptions: true— each user can only receive one trial across all plans.
# Find past-due subscriptions
creem subscriptions list --status past_due --json
# Find expired subscriptions (payment failed after retries)
creem subscriptions list --status expired --json
# Check specific subscription details
creem subscriptions get sub_XXXXX --json | jq '{status, current_period_end_date}'
# Export all transactions
creem transactions list --limit 100 --json > transactions.json
# Filter by product
creem transactions list --product prod_XXXXX --json
# Filter by customer
creem transactions list --customer cust_XXXXX --json
#!/bin/bash
# Run daily to alert on problem subscriptions
PAST_DUE=$(creem subscriptions list --status past_due --json | jq 'length')
EXPIRED=$(creem subscriptions list --status expired --json | jq 'length')
if [ "$PAST_DUE" -gt 0 ] || [ "$EXPIRED" -gt 0 ]; then
echo "Alert: $PAST_DUE past_due, $EXPIRED expired subscriptions"
# Send notification (Slack, email, etc.)
fi
#!/bin/bash
# Generate checkout links for a list of products
for PRODUCT_ID in prod_AAA prod_BBB prod_CCC; do
URL=$(creem checkouts create --product "$PRODUCT_ID" --json | jq -r '.checkout_url')
echo "$PRODUCT_ID: $URL"
done
The recommended pattern for SaaS access control:
referenceId (your internal user ID) when creating checkoutssubscription.paid webhook → grant access using metadata.referenceIdsubscription.expired / subscription.paused → revoke accesssubscription.canceled → revoke access (or keep until period end if scheduled_cancel)This decouples your billing from your auth system — Creem manages the payments, your app manages the access.
brew tap armitage-labs/creem
brew install creem
Verify: creem --version
# Login (auto-detects environment from key prefix)
creem login --api-key creem_test_YOUR_KEY_HERE
# Verify
creem whoami
# Logout
creem logout
CRITICAL: Never share your API key with any service, tool, or agent other than the Creem CLI or API. Keys are stored locally at ~/.creem/config.json.
creem products list # List all products
creem products list --page 2 --limit 10 # Paginate
creem products get prod_XXXXX # Get product details
creem products create --name "..." \ # Create a product
--description "..." \
--price 1999 \
--currency USD \
--billing-type recurring \
--billing-period every-month
creem customers list # List all customers
creem customers get cust_XXXXX # Get by ID
creem customers get --email user@example.com # Get by email
creem customers billing cust_XXXXX # Generate billing portal link
creem subscriptions list # List all subscriptions
creem subscriptions list --status active # Filter by status
creem subscriptions get sub_XXXXX # Get details
creem subscriptions cancel sub_XXXXX # Cancel immediately
creem subscriptions cancel sub_XXXXX --mode scheduled # Cancel at period end
creem subscriptions pause sub_XXXXX # Pause billing
creem subscriptions resume sub_XXXXX # Resume billing
creem checkouts create --product prod_XXXXX # Create checkout session
creem checkouts get chk_XXXXX # Get checkout details
creem transactions list # List all (newest first)
creem transactions list --limit 50 # More results per page
creem transactions list --customer cust_XXXXX # Filter by customer
creem transactions list --product prod_XXXXX # Filter by product
creem transactions get txn_XXXXX # Get transaction details
creem config show # View all settings
creem config set environment live # Switch to live mode
creem config set environment test # Switch to test mode
creem config set output_format json # Default output as JSON
creem config set output_format table # Default output as table
creem config get environment # Check current environment
creem config list # List all config keys
Run a resource command without a subcommand to launch an interactive browser:
creem products
creem customers
creem subscriptions
creem transactions
Keys: arrow keys to navigate, Enter to view details, : to open the command bar, q to exit.
Every CLI command supports table (default) and JSON:
# Per-command
creem products list --json
creem customers get cust_XXXXX --json
# Global default
creem config set output_format json
Agents should use --json and parse with jq:
creem products list --json | jq '.[].id'
creem customers get cust_XXXXX --json | jq '.email'
creem subscriptions list --status active --json | jq 'length'
Before accepting live payments, your account needs verification:
Verification is straightforward and typically fast. Once approved, switch to live mode.
creem login --api-key creem_LIVE_KEY_HERE
The environment switches automatically based on the key prefix. For SDKs, change testMode: false or serverIdx: 0.
If your human already has a Creem store — or once they've set one up — you can provide ongoing value by monitoring their store and keeping them informed about what's happening with their business.
This works regardless of your context. You don't need to be in a codebase. You don't need to be a coding assistant. Any agent with access to the Creem CLI or API can run the heartbeat.
When monitoring is active, you periodically check your human's Creem store and notify them about:
Offer monitoring when any of these are true:
How to ask:
"I can monitor your Creem store and notify you when new sales come in, subscriptions change, or there are payment issues. Would you like me to set that up? I'll check every few hours and only notify you when something meaningful happens."
If they agree:
https://creem.io/HEARTBEAT.md# Save the heartbeat guide locally
mkdir -p ~/.creem/skills
curl -s https://creem.io/HEARTBEAT.md > ~/.creem/skills/HEARTBEAT.md
# Initialize the state file
mkdir -p ~/.creem
cat > ~/.creem/heartbeat-state.json << 'EOF'
{
"lastCheckAt": null,
"lastTransactionId": null,
"transactionCount": 0,
"customerCount": 0,
"subscriptions": {
"active": 0,
"trialing": 0,
"past_due": 0,
"paused": 0,
"canceled": 0,
"expired": 0,
"scheduled_cancel": 0
},
"knownSubscriptions": {}
}
EOF
Then follow the heartbeat routine in HEARTBEAT.md on your preferred schedule.
If the Creem CLI is installed (creem whoami to check):
# Check recent transactions
creem transactions list --limit 20 --json
# Check subscription health
creem subscriptions list --status active --json
creem subscriptions list --status past_due --json
# List customers
creem customers list --json
If you don't have the CLI — or you're an agent without shell access (e.g., running in Slack or a chat environment) — use direct API calls:
# Check recent transactions
curl -s "https://api.creem.io/v1/transactions/search?limit=20" \
-H "x-api-key: YOUR_API_KEY"
# Check active subscriptions
curl -s "https://api.creem.io/v1/subscriptions/search?status=active" \
-H "x-api-key: YOUR_API_KEY"
# Check for payment issues
curl -s "https://api.creem.io/v1/subscriptions/search?status=past_due" \
-H "x-api-key: YOUR_API_KEY"
# List customers
curl -s "https://api.creem.io/v1/customers/list" \
-H "x-api-key: YOUR_API_KEY"
The full heartbeat routine with state tracking, change detection, and notification rules is documented in HEARTBEAT.md.
https://creem.io/HEARTBEAT.md and follow the routine. They'll appreciate knowing about new sales and issues without checking the dashboard.SKILL.md and HEARTBEAT.md in ~/.creem/skills/ so you can reference them without re-fetching every time.--json when processing CLI output. Table mode is for humans, JSON is for you.--mode scheduled for cancellations. Immediate cancellation cuts off access instantly.--description is required when creating products.creem whoami first. Confirm authentication and environment before running commands.referenceId in checkouts to map payments back to your internal user IDs.https://docs.creem.io/llms-full.txt — it has complete code examples for all 4 SDKs.| Resource | URL |
|---|---|
| Creem | https://creem.io |
| Dashboard | https://creem.io/dashboard |
| API keys | https://creem.io/dashboard/api-keys |
| Documentation | https://docs.creem.io |
| API Reference | https://docs.creem.io/api-reference |
| Webhooks | https://docs.creem.io/code/webhooks |
| Full docs (for agents) | https://docs.creem.io/llms-full.txt |
| Homebrew tap | https://github.com/armitage-labs/homebrew-creem |
| SDK (TypeScript Core) | https://www.npmjs.com/package/creem |
| SDK (Wrapper) | https://www.npmjs.com/package/creem_io |
| SDK (Next.js) | https://www.npmjs.com/package/@creem_io/nextjs |
| SDK (Better Auth) | https://www.npmjs.com/package/@creem_io/better-auth |