Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
@spree/sdk
Official TypeScript SDK for the Spree Commerce Store API v3 — fully typed resource clients, guest and customer authentication, carts and checkout, with runtime Zod schemas generated from the API's serializers.
Installation
npm install @spree/sdk
Quick Start
import { createClient } from '@spree/sdk';
const client = createClient({
baseUrl: 'https://api.mystore.com',
publishableKey: 'spree_pk_xxx',
});
// Browse the catalog
const products = await client.products.list({ limit: 10, expand: ['variants', 'media'] });
// Cart + checkout
const cart = await client.carts.create();
await client.carts.items.create(cart.id, { variant_id: 'var_abc123', quantity: 2 }, { spreeToken: cart.token });
// Customer authentication (JWT)
const { token } = await client.auth.login({ email: '[email protected]', password: 'password123' });
const orders = await client.customer.orders.list({}, { token });
Documentation
The full guides live on the docs site — this README intentionally stays short:
- SDK quickstart
- Authentication — publishable key, customer JWT + refresh, guest cart tokens
- Configuration — retries, custom fetch, error handling
- Store resources — products, cart & checkout, payments, account, wishlists, markets
- Extending the client — custom endpoints
- Store API reference
License
MIT