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:

  1. Unified types — A single data model for products, carts, orders, and customers that works across every platform.
  2. Adapter pattern — Each platform implements the CommerceAdapter interface, mapping its API to the unified types.
  3. Pluggable providers — Payment providers implement the PaymentProvider interface, making them interchangeable.
  4. Orchestration enginecreateCommerce() wires adapters, payments, events, and webhooks into a single entry point.

Package Ecosystem

The toolkit is organized as a monorepo of focused packages:

PackagePurpose
@commercejs/typesUnified data model — 20+ domain types
@commercejs/coreOrchestration engine — createCommerce(), event bus, webhooks
@commercejs/checkoutCheckoutSession state machine
@commercejs/payment-tapTap Payments provider
@commercejs/webhook-verifierCryptographic webhook verification
@commercejs/adapter-sallaSalla platform adapter
@commercejs/platformBuilt-in commerce engine — Neon Postgres, Admin API, Profile system
@commercejs/nuxtNuxt module — composables, plugin, and auto-generated REST API
@commercejs/hosted-checkoutReady-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

Next Steps

Installation

Set up the monorepo and install dependencies.

Quick Start

Process your first payment in 5 minutes.

Architecture

Understand how the packages fit together.