Skip to main content
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.
The Quickshops TypeScript SDK gives you a typed, server-side client for every API operation your storefront needs — from fetching products to managing carts and initiating checkout. Install it once, wire up your API key in a server-only module, and call methods from your server boundary.

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.
Never construct Quickshops in client components, hooks, or any file marked "use client". The API key must stay on the server.

Create a server-only client

Instantiate the SDK once in a dedicated server-only file. In Next.js, add import "server-only" so the module cannot be pulled into client bundles.
lib/quickshops.ts
Your API key must start with qk_ and is sent as Authorization: Bearer qk_... on every request.

Constructor options

The REST API base URL is 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 the Quickshops instance, the raw API key, or process.env.HEADLESS_API_KEY to the client.

Method reference

All SDK methods are async 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:
Cart 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.