Back to Spree

@spree/admin-sdk

packages/admin-sdk/README.md

5.6.02.0 KB
Original Source

@spree/admin-sdk

Official TypeScript SDK for the Spree Commerce Admin API — manage products, orders, customers, fulfillments, payments, and store configuration from server-to-server integrations or admin tooling.

Developer Preview. The Admin API is in active development and may change between minor versions. Pin to a specific version of @spree/admin-sdk in production and review the changelog before upgrading.

Installation

bash
npm install @spree/admin-sdk

Quick start

typescript
import { createAdminClient } from '@spree/admin-sdk'

const client = createAdminClient({
  baseUrl: 'https://store.example.com',
  secretKey: 'sk_xxx', // server-to-server; JWT auth for admin UIs also supported
})

const { data: orders } = await client.orders.list({
  status_eq: 'complete',
  sort: '-completed_at',
  limit: 25,
})

const customer = await client.customers.create({
  email: '[email protected]',
  first_name: 'Jane',
  last_name: 'Doe',
  tags: ['wholesale'],
})

Documentation

The full guides live on the docs site — this README intentionally stays short:

Contributing

The SDK lives in the spree/spree monorepo under packages/admin-sdk — see the repository docs for the development setup and the serializer → types → Zod generation pipeline.

License

MIT