The Quickshops JavaScript 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, and call any method from your server-side code.Documentation Index
Fetch the complete documentation index at: https://docs.quickshops.app/llms.txt
Use this file to discover all available pages before exploring further.
Install the package
Create a server-only client
The recommended pattern is to instantiate the SDK once in a dedicated file and re-export the client. Every framework has a different name for this file, butlib/quickshops.ts works well across the board.
lib/quickshops.ts
qk_. Passing any other string causes the constructor to throw a QuickshopsError with code INVALID_API_KEY before any network request is made.
Method reference
All SDK methods areasync and return typed objects. They map directly to REST endpoints under /v1.
| Method | Parameters | Returns | API endpoint |
|---|---|---|---|
qs.store.get() | — | StoreDto | GET /v1/products/store |
qs.products.getAll() | — | { data: ProductDto[], nextCursor: null } | GET /v1/products |
qs.products.getById(id) | productId: string | ProductDto | GET /v1/products/:productId |
qs.cart.create() | — | CartDto | POST /v1/cart |
qs.cart.get(cartId) | cartId: string | CartDto | GET /v1/cart/:cartId |
qs.cart.addLine(cartId, productId, quantity) | cartId: string, productId: string, quantity: number | CartDto | POST /v1/cart/:cartId/lines |
qs.cart.updateLine(cartId, productId, quantity) | cartId: string, productId: string, quantity: number | CartDto | PATCH /v1/cart/:cartId/lines/:productId |
qs.cart.removeLine(cartId, productId) | cartId: string, productId: string | CartDto | DELETE /v1/cart/:cartId/lines/:productId |
qs.cart.clear(cartId) | cartId: string | CartDto | DELETE /v1/cart/:cartId |
qs.checkout.createSession(cartId) | cartId: string | { url: string } | POST /v1/checkout/session |
qs.subscription.createPortalSession(memberSessionId) | memberSessionId: string | { url: string } | POST /v1/subscription/portal |
Key types
CartDto includes the cart’s id, storeId, an array of lines (productId + quantity), and totals (subtotal, total, currency).
ProductDto includes _id, name, description, priceInCents, currency, type ("digital" or "subscription"), billingInterval, imageUrl, isActive, category, and details.
StoreDto includes _id, slug, name, description, logoUrl, isPublished, and paymentsConfigured.