### Install Better Auth Plugin Source: https://docs.creem.io/features/checkout/checkout-api Install the necessary packages for Better Auth integration. ```bash npm install @creem_io/better-auth better-auth ``` -------------------------------- ### Install Creem SDKs and CLI Source: https://docs.creem.io/getting-started/introduction Commands to install the necessary packages or tools for your environment. ```bash npm install creem ``` ```bash npm install @creem_io/nextjs ``` ```bash brew tap armitage-labs/creem brew install creem creem login --api-key creem_test_YOUR_KEY ``` ```text Read https://creem.io/SKILL.md and set up Creem for me ``` -------------------------------- ### Install @creem_io/nextjs with bun Source: https://docs.creem.io/code/sdks/nextjs Install the official Creem adapter for Next.js using bun. ```bash bun install @creem_io/nextjs ``` -------------------------------- ### Start the development server Source: https://docs.creem.io/code/sdks/templates Launch the local development server. ```bash yarn dev ``` -------------------------------- ### Set up environment variables Source: https://docs.creem.io/code/sdks/templates Initialize the environment configuration file from the provided example template. ```bash cp .env.example .env # Edit .env and fill in the required variables ``` -------------------------------- ### Install dependencies Source: https://docs.creem.io/code/sdks/templates Install the required project dependencies using your preferred package manager. ```bash yarn install ``` ```bash npm install ``` ```bash pnpm install ``` ```bash bun install ``` -------------------------------- ### Install React SDK Source: https://docs.creem.io/features/checkout/embedded-checkout Commands to install the Creem React package using various package managers. ```bash npm install @creem_io/react ``` ```bash yarn add @creem_io/react ``` ```bash pnpm add @creem_io/react ``` ```bash bun add @creem_io/react ``` -------------------------------- ### Install @creem_io/nextjs with npm Source: https://docs.creem.io/code/sdks/nextjs Install the official Creem adapter for Next.js using npm. ```bash npm install @creem_io/nextjs ``` -------------------------------- ### Install the creem SDK Source: https://docs.creem.io/code/sdks/migrate-from-creem-io Install the official SDK alongside the existing creem_io package to facilitate a gradual migration. ```bash npm install creem ``` ```bash pnpm add creem ``` ```bash yarn add creem ``` ```bash bun add creem ``` -------------------------------- ### Install TypeScript SDK Source: https://docs.creem.io/features/checkout/checkout-api Install the core TypeScript SDK for general JavaScript framework integration. ```bash npm install creem ``` ```bash yarn add creem ``` ```bash pnpm install creem ``` ```bash bun install creem ``` -------------------------------- ### Install the Strapi plugin Source: https://docs.creem.io/integrations/strapi Run this command in your Strapi project directory to install the Creem plugin. ```bash npm i @creem_io/strapi ``` -------------------------------- ### Authentication Request Example Source: https://docs.creem.io/api-reference/error-codes cURL command demonstrating how to include the x-api-key header in a request. ```bash curl -X GET https://api.creem.io/v1/products \ -H "x-api-key: creem_YOUR_API_KEY" ``` -------------------------------- ### Install @creem_io/nextjs with pnpm Source: https://docs.creem.io/code/sdks/nextjs Install the official Creem adapter for Next.js using pnpm. ```bash pnpm install @creem_io/nextjs ``` -------------------------------- ### Install @creem_io/nextjs with yarn Source: https://docs.creem.io/code/sdks/nextjs Install the official Creem adapter for Next.js using yarn. ```bash yarn add @creem_io/nextjs ``` -------------------------------- ### Install and Login to Creem CLI Source: https://docs.creem.io/ai/introduction Install the Creem CLI using Homebrew and log in with your API key. This allows you to manage your store directly from the terminal. ```bash brew tap armitage-labs/creem && brew install creem creem login --api-key creem_test_YOUR_KEY_HERE ``` -------------------------------- ### Install Vue SDK Source: https://docs.creem.io/features/checkout/embedded-checkout Commands to install the Creem Vue package using various package managers. ```bash npm install @creem_io/vue ``` ```bash yarn add @creem_io/vue ``` ```bash pnpm add @creem_io/vue ``` ```bash bun add @creem_io/vue ``` -------------------------------- ### Install Next.js SDK Source: https://docs.creem.io/features/checkout/checkout-api Install the required package for Next.js integration using your preferred package manager. ```bash npm install @creem_io/nextjs ``` ```bash yarn add @creem_io/nextjs ``` ```bash pnpm install @creem_io/nextjs ``` ```bash bun install @creem_io/nextjs ``` -------------------------------- ### Install Skills via Claude Marketplace Source: https://docs.creem.io/ai/for-agents/skill-files Alternative installation method for Claude Code users to add skills directly via plugin commands. ```bash /plugin marketplace add armitage-labs/creem-skills /plugin install creem-api@creem-skills ``` -------------------------------- ### Install Better Auth Creem Plugin with bun Source: https://docs.creem.io/code/sdks/better-auth Install the Better Auth Creem plugin using bun. If you're using a separate client and server setup, install the plugin in both parts of your project. ```bash bun install @creem_io/better-auth ``` -------------------------------- ### Install Better Auth Creem Plugin with yarn Source: https://docs.creem.io/code/sdks/better-auth Install the Better Auth Creem plugin using yarn. If you're using a separate client and server setup, install the plugin in both parts of your project. ```bash yarn add @creem_io/better-auth ``` -------------------------------- ### Start Strapi in development mode Source: https://docs.creem.io/integrations/strapi Navigate to the project directory and launch the development server. ```bash cd my-strapi-app npm run develop ``` -------------------------------- ### Install Better Auth Creem Plugin with pnpm Source: https://docs.creem.io/code/sdks/better-auth Install the Better Auth Creem plugin using pnpm. If you're using a separate client and server setup, install the plugin in both parts of your project. ```bash pnpm add @creem_io/better-auth ``` -------------------------------- ### Install Better Auth Creem Plugin with npm Source: https://docs.creem.io/code/sdks/better-auth Install the Better Auth Creem plugin using npm. If you're using a separate client and server setup, install the plugin in both parts of your project. ```bash npm install @creem_io/better-auth ``` -------------------------------- ### Windsurf Knowledge Base Setup Source: https://docs.creem.io/code/sdks/ai-agents Commands for cloning the skill repository and referencing it in Windsurf conversations. ```bash git clone https://github.com/armitage-labs/creem-skills.git .windsurf/creem ``` ```text Using the Creem skill, help me implement subscription billing ``` -------------------------------- ### Install Creem Dependency Source: https://docs.creem.io/getting-started/quickstart Command to install the required Creem package. ```bash npm install creem ``` -------------------------------- ### Create Products and Checkouts via CLI Source: https://docs.creem.io/getting-started/introduction Use the CLI to define product parameters and generate checkout sessions. ```bash creem products create \ --name "Pro Plan" \ --price 1999 \ --currency USD \ --billing-type recurring \ --billing-period every-month creem checkouts create --product prod_XXXXX ``` -------------------------------- ### Install the Creem plugin Source: https://docs.creem.io/llms-full.txt Install the required package using your preferred package manager. ```bash npm install @creem_io/better-auth ``` ```bash pnpm add @creem_io/better-auth ``` ```bash yarn add @creem_io/better-auth ``` ```bash bun install @creem_io/better-auth ``` -------------------------------- ### Manage Products via CLI Source: https://docs.creem.io/code/cli Commands for listing, retrieving, and creating products. Use specific flags for pagination and billing configuration. ```bash # List all products creem products list # List with pagination creem products list --page 2 --limit 10 # Get a specific product creem products get prod_XXXXX # Create a product creem products create \ --name "Pro Plan" \ --description "Monthly pro subscription with all features" \ --price 1999 \ --currency USD \ --billing-type recurring \ --billing-period every-month ``` -------------------------------- ### Install and Update Skill Files Source: https://docs.creem.io/ai/for-agents/skill-files Use these commands to create the local skills directory and download or refresh the required SKILL.md and HEARTBEAT.md files. ```bash # Create the skills directory mkdir -p ~/.creem/skills # Download both skill files curl -s https://creem.io/SKILL.md > ~/.creem/skills/SKILL.md curl -s https://creem.io/HEARTBEAT.md > ~/.creem/skills/HEARTBEAT.md ``` ```bash # Update skills curl -s https://creem.io/SKILL.md > ~/.creem/skills/SKILL.md curl -s https://creem.io/HEARTBEAT.md > ~/.creem/skills/HEARTBEAT.md ``` -------------------------------- ### Fetch full documentation Source: https://docs.creem.io/ai/for-agents/skill-files Retrieves the complete project documentation in a format optimized for AI agents. ```bash curl -s https://docs.creem.io/llms-full.txt ``` -------------------------------- ### Install creem_io package Source: https://docs.creem.io/code/sdks/typescript-wrapper Use your preferred package manager to install the creem_io library. ```bash npm install creem_io ``` ```bash yarn add creem_io ``` ```bash pnpm add creem_io ``` ```bash bun add creem_io ``` -------------------------------- ### Initialize Heartbeat Monitoring Source: https://docs.creem.io/ai/for-agents/skill-files Commands to fetch the heartbeat guide and initialize the local state file for tracking. ```bash # Fetch the heartbeat guide curl -s https://creem.io/HEARTBEAT.md # Save locally curl -s https://creem.io/HEARTBEAT.md > ~/.creem/skills/HEARTBEAT.md # Initialize state file 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 ``` -------------------------------- ### OpenAPI Configuration Examples Source: https://docs.creem.io/essentials/settings Configure OpenAPI file paths using absolute URLs, relative paths, or an array for multiple files. ```json "openapi": "https://example.com/openapi.json" ``` ```json "openapi": "/openapi.json" ``` ```json "openapi": ["https://example.com/openapi1.json", "/openapi2.json", "/openapi3.json"] ``` -------------------------------- ### AI Setup Prompt Source: https://docs.creem.io/code/cli Use this prompt to instruct an AI agent to configure the Creem CLI. ```text Read https://creem.io/SKILL.md and set up the Creem CLI for me ``` -------------------------------- ### Claude Code Interaction Example Source: https://docs.creem.io/llms-full.txt Example prompt for initiating a checkout flow integration. ```text Help me create a checkout flow for my SaaS product ``` -------------------------------- ### Create a customer credit account Source: https://docs.creem.io/llms-full.txt Use the POST endpoint to initialize a new credit account for a specific customer. The initial_balance parameter is optional but ensures atomic creation if provided. ```bash curl -X POST https://api.creem.io/v1/customer-credits/accounts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_abc123", "name": "loyalty_points", "unit_label": "points", "initial_balance": "100" }' ``` -------------------------------- ### OpenAPI Specification for Get Transaction Source: https://docs.creem.io/api-reference/endpoint/get-transaction Defines the GET /v1/transactions endpoint and the TransactionEntity schema. ```yaml openapi: 3.0.0 info: title: Creem API description: >- Creem is an all-in-one platform for managing subscriptions and recurring revenue, tailored specifically for today's SaaS companies. It enables you to boost revenue, enhance customer retention, and scale your operations seamlessly. version: v1 contact: name: Creem Support url: https://creem.io email: support@creem.io license: name: Commercial url: https://creem.io/terms termsOfService: https://creem.io/terms servers: - url: https://api.creem.io description: Production — live API for processing real transactions and data. x-speakeasy-server-id: prod - url: https://test-api.creem.io description: Test — sandbox API for development and testing with no real charges. x-speakeasy-server-id: test security: [] tags: [] externalDocs: description: Creem Documentation url: https://docs.creem.io paths: /v1/transactions: get: tags: - Transactions summary: Get a transaction by ID description: >- Retrieve a single transaction by ID. View payment details, status, and associated order information. operationId: getTransactionById parameters: - name: transaction_id required: true in: query description: The unique identifier of the transaction. schema: example: txn_1234567890 type: string responses: '200': description: Successfully retrieved transaction content: application/json: schema: $ref: '#/components/schemas/TransactionEntity' '400': description: Bad Request - Invalid input parameters '401': description: Unauthorized - Invalid or missing API key '404': description: Not Found - Resource does not exist security: - ApiKey: [] components: schemas: TransactionEntity: type: object properties: id: type: string description: Unique identifier for the object. mode: $ref: '#/components/schemas/EnvironmentMode' object: type: string description: >- String representing the object's type. Objects of the same type share the same value. example: transaction amount: type: number description: The transaction amount in cents. 1000 = $10.00 example: 2000 amount_paid: type: number description: The amount the customer paid in cents. 1000 = $10.00 example: 2000 nullable: true discount_amount: type: number description: The discount amount in cents. 1000 = $10.00 example: 2000 nullable: true currency: type: string description: >- Three-letter ISO currency code, in uppercase. Must be a supported currency. example: USD type: $ref: '#/components/schemas/TransactionType' tax_country: type: string description: The ISO alpha-2 country code where tax is collected. example: US pattern: ^[A-Z]{2}$ nullable: true tax_amount: type: number description: The sale tax amount in cents. 1000 = $10.00 example: 2000 nullable: true status: $ref: '#/components/schemas/TransactionStatus' refunded_amount: type: number description: The amount that has been refunded in cents. 1000 = $10.00 example: 2000 nullable: true order: type: string description: The order associated with the transaction. nullable: true subscription: type: string description: The subscription associated with the transaction. nullable: true customer: type: string description: The customer associated with the transaction. nullable: true description: type: string description: The description of the transaction. period_start: type: number description: Start period for the invoice as timestamp period_end: type: number description: End period for the invoice as timestamp created_at: type: number description: Creation date of the order as timestamp required: - id - mode - object - amount - currency ``` -------------------------------- ### Create a New Product Source: https://docs.creem.io/ai/for-agents/cli Create a new product with specified name, description, price, currency, and billing details. Supports recurring or one-time billing. ```bash creem products create \ --name "Pro Plan" \ --description "Monthly pro subscription with all features" \ --price 1999 \ --currency USD \ --billing-type recurring \ --billing-period every-month ``` -------------------------------- ### Scaffold a new Strapi project Source: https://docs.creem.io/integrations/strapi Use the Strapi CLI to initialize a new project directory. ```bash npx create-strapi@latest my-strapi-app ``` -------------------------------- ### Install Creem SDK Source: https://docs.creem.io/code/sdks/typescript Install the official Creem package using your preferred package manager. ```bash npm install creem ``` ```bash yarn add creem ``` ```bash pnpm add creem ``` ```bash bun add creem ``` -------------------------------- ### Implement Prepaid Balance Wallets Source: https://docs.creem.io/llms-full.txt Manage customer credit packs by creating a wallet, topping up balances via webhooks, and deducting credits for feature usage. ```bash # Create wallet curl -X POST https://api.creem.io/v1/customer-credits/accounts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "cust_abc123", "name": "prepaid_balance", "unit_label": "credits" }' # Top up after they buy a credit pack (in your checkout.completed webhook) curl -X POST https://api.creem.io/v1/customer-credits/accounts/{account_id}/credit \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": "1000", "reference": "topup_order_123", "idempotency_key": "topup_order_123" }' # Deduct when they use a feature curl -X POST https://api.creem.io/v1/customer-credits/accounts/{account_id}/debit \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": "25", "reference": "usage_evt_456", "idempotency_key": "usage_evt_456" }' ``` -------------------------------- ### Install Svelte SDK Source: https://docs.creem.io/features/checkout/embedded-checkout Commands to install the Creem Svelte package using various package managers. ```bash npm install @creem_io/svelte ``` ```bash yarn add @creem_io/svelte ``` ```bash pnpm add @creem_io/svelte ``` ```bash bun add @creem_io/svelte ``` -------------------------------- ### Cursor Project Setup Source: https://docs.creem.io/code/sdks/ai-agents Commands and configuration for adding Creem skills to Cursor projects. ```bash git clone https://github.com/armitage-labs/creem-skills.git .cursor/skills ``` ```text @.cursor/skills/creem-api/Skill.md Help me create a checkout flow ``` ```text When working with Creem payment integration: - Use the Creem API at https://api.creem.io (or test-api.creem.io for test mode) - Authenticate with x-api-key header - Always verify webhook signatures using HMAC-SHA256 - Prices are in cents (1000 = $10.00) - Reference: .cursor/skills/creem-api/ ``` -------------------------------- ### Launch Interactive Mode for Subscriptions Source: https://docs.creem.io/ai/for-agents/cli Enter interactive mode for managing subscriptions. Use arrow keys to navigate, Enter to view details, ':' to open the command bar, and 'q' to exit. ```bash creem subscriptions ``` -------------------------------- ### Install Creem CLI via npm Source: https://docs.creem.io/code/cli Install the CLI globally using the npm package manager. ```bash npm install -g @creem_io/cli ``` -------------------------------- ### Install Creem CLI Source: https://docs.creem.io/ai/for-humans/cli Methods to install the CLI tool using package managers or run it directly. ```bash brew tap armitage-labs/creem brew install creem ``` ```bash npm install -g @creem_io/cli ``` ```bash npx @creem_io/cli ``` -------------------------------- ### Authenticate with Live API Key Source: https://docs.creem.io/ai/for-humans/cli Switch the CLI to live mode by logging in with a production API key. ```bash creem login --api-key creem_LIVE_KEY_HERE ``` -------------------------------- ### Verify Creem CLI Installation Source: https://docs.creem.io/ai/for-agents/cli Check if the Creem CLI has been installed correctly by running the version command. ```bash creem --version ``` -------------------------------- ### Credit New User Welcome Bonus Source: https://docs.creem.io/guides/customer-credits-recipes Credit the new user's account with a welcome bonus when they sign up through a referral. This incentivizes new signups. ```bash # Credit the new user (welcome bonus) curl -X POST https://api.creem.io/v1/customer-credits/accounts/{referee_account_id}/credit \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": "200", "reference": "referred_welcome", "idempotency_key": "referred_welcome_cust_newuser" }' ``` -------------------------------- ### AI Agent Onboarding Prompt Source: https://docs.creem.io/getting-started/introduction Use this prompt with AI coding assistants to automate the installation, configuration, and integration of Creem. ```text Read https://creem.io/SKILL.md and set up Creem for me ```