Developers only. Selling through the built-in Quickshops storefront does not require the SDK. Start with the Quickstart if you’re setting up a store as a seller.The SDK requires a Pro plan API key from Settings → API keys. See Authentication for setup.
Install the package
Package structure
@quickshops/sdk is the official TypeScript client for the Quickshops Headless API. Instantiate it only in server-only modules (loaders, actions, API routes) and pass response data to your UI.
Create a server-only client
Instantiate the SDK once in a dedicated server-only file. In Next.js, addimport "server-only" so the module cannot be pulled into client bundles.
lib/quickshops.ts
qk_ and is sent as Authorization: Bearer qk_... on every request.
Constructor options
https://api.quickshops.app/v1. The SDK serverURL defaults to https://api.quickshops.app and adds /v1 to each request path automatically.
For local development against a running API instance:
Passing data to the browser safely
Fetch with the SDK on the server, then pass only the response data to client components as props or through your own API routes. Never pass theQuickshops instance, the raw API key, or process.env.HEADLESS_API_KEY to the client.
Method reference
All SDK methods areasync and map to REST endpoints on the API base URL. Responses are wrapped in { data: ... } unless noted otherwise.
SDK response shapes
Every method returns a response object. Unwrap the payload with.data:
data includes id, storeId, lines (productId + quantity), and totals (subtotal, total, currency).
Product data items use id (not _id), plus storeId, name, description, priceInCents, currency, type ("digital" or "subscription"), billingInterval, imageUrl, isActive, category, and details.
Store data includes id, slug, name, description, logoUrl, isPublished, paymentsConfigured, optional templateKey, and templateTexts.
Checkout session data is { url: string }.
Next steps
Framework guides
Setup examples for Next.js, Remix, and other frameworks.
Error handling
Handle API errors and retries in your app.
API reference
Full REST API documentation.