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.
useStore() from @quickshops/sdk so you do not hand-roll redirects, cart cookies, or success-page session lookups.
Install the package
@quickshops/sdk@1.1.0+ for useStore() plus the @quickshops/sdk/react export (Storefront composition primitives).
useStore() (recommended for storefronts)
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). SetHEADLESS_API_KEY, optional HEADLESS_API_URL, and SITE_URL on the host after it scaffolds.
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:
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
PreferuseStore(). Or construct the low-level client manually:
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:
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.