DevelopersSDK vs REST

SDK vs REST

Both reach the same /api/v1 endpoints. Choose by your stack.

  • Use @orchard/sdk if you’re on Next.js and want typed contracts, React client hooks, batching, and retries for free.
  • Use raw REST if you’re on another framework, building a non-web client, or want zero dependencies.

Recommended mix: the SDK on your server route handlers (sk_* keys), the SDK’s client-safe subset on the frontend (pk_* reads + checkout:write), and raw REST anywhere else.

The SDK is a private monorepo package today; the operator publishes it (npm or a private registry granted to your GitHub org) at Orchard v1. Until then, prototype against raw REST — every endpoint in the spec is callable now.

Generate types from the spec

This works today, with no SDK dependency:

npx openapi-typescript https://docs.theorchard.dev/openapi.generated.json \
  -o src/orchard-types.ts

You get a fully-typed network boundary against the exact shape the live API exposes.