docs/developer/sdk/admin/quickstart.mdx
@spree/admin-sdk is the official TypeScript SDK for the Admin API v3 — the back-office counterpart to @spree/sdk. Use it to build integrations, automations, internal tools, and custom admin UIs: manage products, orders, customers, stock, promotions, webhooks, and more.
npm install @spree/admin-sdk@next
Create a client with a secret API key (server-to-server) and start calling resources:
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: process.env.SPREE_SECRET_KEY, // sk_xxx — server-side only
})
// List recent completed orders
const { data: orders, meta } = await client.orders.list({
status_eq: 'complete',
sort: '-completed_at',
limit: 25,
})
// Create a purchasable product — pricing lives on variants
const product = await client.products.create({
name: 'Aero Hoodie',
status: 'active',
tags: ['new-arrivals'],
variants: [
{
sku: 'AERO-HOODIE',
prices: [{ currency: 'USD', amount: '59.00' }],
},
],
})
Every method is fully typed — responses use Admin-prefixed types generated from the API serializers:
import type { AdminOrder, PaginatedResponse } from '@spree/admin-sdk'
const page: PaginatedResponse<AdminOrder> = await client.orders.list()