Creem
A Creem component for Bijection.
git clone https://github.com/bijectionhq/creem.git
cd creem
git checkout c6ea447308fa972a2cc22f55d1fd929660db8dc3
cd packages/integrations/convexBijection repository access is required. Request access.
Description
A Creem component for Bijection.
Explore the package README for API concepts, configuration, and examples. Check the Bijection source for adaptation-specific setup.
Review the source and its dependencies before adopting this package. Source availability does not establish npm publication or runtime qualification.
Getting started
- Get the source at the revision above and read its package documentation.
- Check the required Bijection SDK version, dependencies, and external service credentials.
- Follow the package setup instructions and the guide to using components.
- Exercise the component in your deployment according to your project’s verification rules.
Open source
Maintained source: bijectionhq/creem. Based on armitage-labs/creem. License: MIT. Consult the repository for license terms, notices, and contributor attribution.
From the upstream publisher
A Creem component for Convex.
Explore the demo ↗Upstream overview
From the upstream package documentation.
The @creem_io/convex package integrates Creem's Merchant of Record billing platform directly into Convex applications, providing backend helpers and React/Svelte UI widgets for subscriptions, one-time purchases, seat-based pricing, and customer portal access. It handles checkout session creation, webhook processing, and subscription state synchronization within the Convex backend. Creem acts as the legal seller of your software, managing global tax compliance across 140+ countries, payment processing, and automated payouts.
Use cases
From the upstream package documentation.
- Adding subscription billing to a Convex app without building a separate payment backend or managing Stripe webhook infrastructure yourself
- Implementing seat-based pricing where subscription state needs to be queryable from Convex functions alongside application data
- Dropping in pre-built React or Svelte checkout and customer portal widgets without writing custom billing UI components
- Selling software globally and offloading US state tax, EU VAT, and other compliance obligations to a Merchant of Record
- Handling subscription lifecycle events such as upgrades, downgrades, trials, and cancellations with webhook handlers that write directly to the Convex database
How it works
From the upstream package documentation.
The component is installed via npm as @creem_io/convex and configured with a Creem API key. It exposes backend helpers that run as Convex actions to call the Creem API for checkout session creation and subscription management, and webhook handlers that verify incoming Creem webhook payloads and persist subscription state to the Convex database.
Webhook events such as checkout.completed and subscription.canceled are verified using a webhook secret and dispatched to typed handler callbacks, following the same pattern as the broader Creem SDK. This keeps billing state in sync with your Convex tables without requiring a separate server.
The package ships pre-built React and Svelte UI widgets for checkout flows and the customer portal, which can be embedded directly into your frontend. These widgets coordinate with the backend helpers to initiate checkouts and reflect current subscription status from Convex queries.
Creem functions as a Merchant of Record, meaning tax calculation, VAT collection, fraud protection, and payout handling are all managed externally. Your application only needs to provision or revoke access based on the subscription events delivered through the webhook integration.
Upstream package FAQ
Does Convex Creem work with existing Convex projects?
Yes, Convex Creem is designed as a drop-in component for existing Convex applications. You install the npm package, configure your billing settings, and start using the provided functions and widgets. It integrates with your existing Convex schema and functions without requiring architectural changes.
What payment providers does this component support?
Convex Creem integrates with Creem's billing platform, which handles payment processing and subscription management. The component abstracts the payment provider details and gives you a unified API for all billing operations within your Convex app.
Can I customize the billing UI widgets?
The component provides React and Svelte widgets for common billing scenarios like checkout flows and customer portals. These widgets are designed to be customizable and work with your existing component styling. You also get access to the underlying Convex functions to build completely custom billing interfaces.
How does seat-based pricing work with Convex functions?
Convex Creem includes functions to check seat limits and usage within your Convex mutations and queries. You can enforce seat-based quotas directly in your business logic and use the provided APIs to let customers upgrade their seat count when they hit limits.
Use with agents and CLI
Give your coding agent the component’s source identity and setup guidance.
Help me integrate Creem with Bijection.
Read: https://bijection.com/components/creem/SKILL.md
Check SDK compatibility and dependency availability.
Follow this project's execution and verification rules.Upstream README.md
View repository ↗Documentation from armitage-labs/creem, recorded October 23, 2026. APIs and setup may differ in the Bijection adaptation.
What is CREEM?
CREEM is a Merchant of Record (MoR) that lets software companies sell globally without worrying about sales tax, VAT, compliance, or payment infrastructure. We act as the legal seller of your software, so you can focus on building.
What we handle for you:
- 🌍 Global tax compliance across 140+ countries (US state taxes, EU VAT, UK VAT, and more)
- 💳 Payment processing with optimized checkout experiences
- 🔄 Subscription management with trials, upgrades, downgrades, and dunning
- 💸 Automated payouts to your bank account
- 📊 Revenue analytics and reporting
- 🛡️ Fraud protection and chargeback handling
- 🏪 Storefronts for no-code product pages
- 🤝 Affiliate programs with built-in tracking and payouts
Repository Structure
This is a pnpm monorepo containing all of CREEM's open-source packages, SDKs, and documentation.
creem/
├── packages/
│ ├── creem-sdk/ # Official TypeScript SDK (auto-generated via Speakeasy)
│ ├── creem-io/ # Lightweight TypeScript wrapper (framework-agnostic)
│ ├── nextjs/ # Next.js integration (@creem_io/nextjs)
│ ├── better-auth/ # Better Auth plugin (@creem_io/better-auth)
│ ├── convex/ # Convex integration (@creem_io/convex)
│ ├── webhook-types/ # Shared webhook type definitions
│ └── docs/ # Documentation site (Mintlify)
├── .github/workflows/ # CI, release, and SDK generation pipelines
├── turbo.json # Turborepo build configuration
└── pnpm-workspace.yaml # Workspace package definitions
Packages
| Package | npm | Description |
|---|---|---|
creem | Official TypeScript SDK with full API coverage, MCP server, and standalone functions | |
creem_io | Lightweight wrapper SDK, framework-agnostic, zero dependencies | |
@creem_io/nextjs | Next.js integration with React components and webhook handlers | |
@creem_io/better-auth | Better Auth plugin for payments and subscription management | |
@creem_io/convex | Convex billing component with backend helpers and React/Svelte widgets | |
@creem_io/webhook-types | Shared TypeScript types for webhook events |
Quick Start
1. Install
# Official SDK (recommended for most use cases)
npm install creem
# Or the lightweight wrapper
npm install creem_io
# Next.js integration
npm install @creem_io/nextjs
# Better Auth plugin
npm install @creem_io/better-auth
# Convex integration
npm install @creem_io/convex
2. Create a Checkout
import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env.CREEM_API_KEY,
});
const checkout = await creem.checkouts.create({
productId: "prod_123",
successUrl: "https://yourapp.com/success",
});
// Redirect your customer to checkout.checkoutUrl
3. Handle Webhooks
import { Creem } from "creem_io";
const creem = new Creem({ apiKey: process.env.CREEM_API_KEY });
// Verify and parse webhook payload
const event = creem.webhooks.verify(rawBody, signature, webhookSecret);
switch (event.eventType) {
case "checkout.completed":
// Provision access
break;
case "subscription.canceled":
// Revoke access
break;
}
Next.js Example
// app/api/checkout/route.ts
import { createCheckout } from "@creem_io/nextjs/server";
export async function POST() {
const checkout = await createCheckout({
productId: "prod_123",
successUrl: "/success",
});
return Response.redirect(checkout.checkoutUrl);
}
// app/api/webhook/creem/route.ts
import { handleWebhook } from "@creem_io/nextjs/server";
export const POST = handleWebhook({
onCheckoutCompleted: async (event) => {
// Provision access for the customer
},
onSubscriptionCanceled: async (event) => {
// Revoke access
},
});
Documentation
The full documentation lives in packages/docs and is deployed at docs.creem.io.
Built with Mintlify, it covers:
- Getting Started guides for new merchants
- API Reference with interactive examples
- SDK guides for every package in this repo
- Webhook events and payload schemas
- MoR explainers on tax compliance and payouts
Running Docs Locally
# Install Mintlify CLI
npm i -g mintlify
# Start local dev server
cd packages/docs
mintlify dev
AI-Friendly Docs
CREEM provides llms.txt and llms-full.txt for AI agents and LLMs to consume structured documentation. We also ship Skill Files for agent frameworks that support them.
Development
Prerequisites
Setup
# Clone the repo
git clone https://github.com/armitage-labs/creem.git
cd creem
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Type check
pnpm typecheck
Monorepo Commands
This repo uses Turborepo for orchestrating builds across packages.
# Build everything
pnpm build
# Build a specific package
pnpm turbo build --filter=creem
# Run tests for a specific package
pnpm turbo test --filter=@creem_io/better-auth
# Format code
pnpm format
# Check formatting
pnpm format:check
Changesets
We use Changesets for versioning and publishing.
# Create a changeset after making changes
pnpm changeset
# Version packages (CI does this automatically)
pnpm version-packages
# Publish (CI does this automatically)
pnpm release
Architecture
┌─────────────────────────────────────────────────┐
│ Your Application │
├──────────┬──────────┬──────────┬────────────────┤
│ creem │ creem_io │ nextjs │ better-auth │
│ (SDK) │(wrapper) │ (React) │ (plugin) │
├──────────┴──────────┴──────────┴────────────────┤
│ @creem_io/webhook-types │
├──────────────────────────────────────────────────┤
│ CREEM API (v1) │
│ https://api.creem.io/v1 │
└──────────────────────────────────────────────────┘
creem(SDK): Auto-generated from the OpenAPI spec via Speakeasy. Full API coverage, retry logic, MCP server support. This is the recommended SDK for most use cases.creem_io(wrapper): Hand-written lightweight SDK with zero dependencies. Framework-agnostic, works anywhere Node.js runs. Ideal for minimal setups or when you want full control.@creem_io/nextjs: React components and server utilities built specifically for Next.js App Router. Drop-in checkout buttons, webhook route handlers, and subscription access helpers.@creem_io/better-auth: Plugin for the Better Auth framework. Syncs CREEM customers with your auth users, manages subscriptions in your database, and handles webhooks automatically.@creem_io/webhook-types: Shared TypeScript type definitions for all CREEM webhook events. Used internally by other packages.
CI/CD
| Workflow | Trigger | Description |
|---|---|---|
| CI | Push/PR to main | Builds, typechecks, tests, and lints changed packages |
| Release | Push to main | Creates release PRs via Changesets, publishes to npm |
| SDK Generation | Daily / manual | Regenerates the creem SDK from the latest OpenAPI spec |
| Docs Deploy | Changes to packages/docs | Deploys documentation to docs.creem.io via Mintlify |
Contributing
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a branch for your feature or fix
git checkout -b feat/my-feature - Make your changes and add tests where appropriate
- Create a changeset if your change affects a published package
pnpm changeset - Run checks to make sure everything passes
pnpm build && pnpm test && pnpm typecheck - Open a Pull Request against
main
Contribution Guidelines
- Follow the existing code style (Prettier is configured)
- Write tests for new functionality
- Keep PRs focused on a single change
- Update documentation for user-facing changes
- Use conventional commits for commit messages
Package-Specific Notes
creem(SDK): This package is auto-generated. Don't edit files insrc/directly. Instead, update the OpenAPI spec or Speakeasy configuration.packages/docs: Documentation uses Mintlify MDX format. API reference pages are generated fromopenapi.json. See the docs README for details.creem_io: When adding new API resources, follow the existing pattern inresources/and add corresponding types intypes/.
Community
- 💬 Discord for questions and discussion
- 🐛 GitHub Issues for bug reports
- 💡 Feature Requests on Featurebase
- 🐦 Twitter/X for updates
License
This project is licensed under the MIT License.