Getting Started
Introduction
CommerceJS is a modular, provider-agnostic eCommerce toolkit for JavaScript and TypeScript.
CommerceJS is a modular eCommerce SDK that provides unified types, a checkout engine, and pluggable payment providers. It works across any JavaScript runtime — Node.js, Edge, Deno, or the browser.
The Problem
Every eCommerce platform has its own API, data shapes, and payment flow. Building a storefront that works with Salla requires completely different code than one for Shopify or WooCommerce. Switching payment providers means rewriting your checkout.
CommerceJS solves this with three core ideas:
- Unified types — A single data model for products, carts, orders, and customers that works across every platform.
- Adapter pattern — Each platform implements the
CommerceAdapterinterface, mapping its API to the unified types. - Pluggable providers — Payment providers implement the
PaymentProviderinterface, making them interchangeable. - Orchestration engine —
createCommerce()wires adapters, payments, events, and webhooks into a single entry point.
Package Ecosystem
The toolkit is organized as a monorepo of focused packages:
| Package | Purpose |
|---|---|
@commercejs/types | Unified data model — 20+ domain types |
@commercejs/core | Orchestration engine — createCommerce(), event bus, webhooks |
@commercejs/checkout | CheckoutSession state machine |
@commercejs/payment-tap | Tap Payments provider |
@commercejs/webhook-verifier | Cryptographic webhook verification |
@commercejs/adapter-salla | Salla platform adapter |
@commercejs/platform | Built-in commerce engine — Neon Postgres, Admin API, Profile system |
@commercejs/nuxt | Nuxt module — composables, plugin, and auto-generated REST API |
@commercejs/hosted-checkout | Ready-to-deploy Nuxt checkout page |
Who Is This For?
CommerceJS is designed for developers building:
- Storefronts that need to work with multiple eCommerce backends
- Checkout flows with pluggable payment providers
- Multi-tenant platforms where each merchant uses a different payment gateway
- Headless commerce applications that need a clean separation between frontend and backend