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. For custom storefronts (Lovable / v0 / Next.js), start with useStore() from @quickshops/sdk so you do not hand-roll redirects, cart cookies, or success-page session lookups.

Install the package

Requires @quickshops/sdk@1.1.0+ for useStore() plus the @quickshops/sdk/react export (Storefront composition primitives).
lib/quickshops.ts
app/actions.ts
useStore reads HEADLESS_API_KEY, optional HEADLESS_API_URL, and SITE_URL from the environment. It returns buyNow, loadCatalog, getCheckoutSession, cart cookie helpers, and more. It is a server factory, not a React hook. Keep qk_ on the server and pass data / Server Actions into @quickshops/sdk/react. There is no publishable browser API key.

One-prompt install

Paste into Lovable, v0.dev, Cursor, or Bolt (Next.js App Router). Set HEADLESS_API_KEY, optional HEADLESS_API_URL, and SITE_URL on the host after it scaffolds.
Optional agent skill:

React components (@quickshops/sdk/react)

Prebuilt shadcn-style composition primitives that never hold your API key. They use your app’s theme CSS variables (--primary, --card, …). Wire Server Actions through Storefront.Provider:
Full guide: React components.

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

Create a server-only client

Prefer useStore(). Or construct the low-level client manually:
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:
Prefer catalogGet() for home pages — it returns { store, products } in one call. Cart data includes id, storeId, lines (productId, quantity, optional expanded product), 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, currency, contact/SEO fields, theme, paymentsConfigured, optional templateKey, and templateTexts. Checkout create data is { url: string, sessionId: string }. Session status data includes paymentStatus, amountTotal, currency, customerEmail, and lineItems.

Next steps

React components

Storefront composition primitives and CheckoutSuccess.

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.