packages/sdk/README.md
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.
npm install @spree/sdk
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 });
The full guides live on the docs site — this README intentionally stays short:
MIT