This page is the curated reference. The complete, generated type reference lives at /kit/api/core and is regenerated from the published typings.
@quickbutik/kit, and runs on a server and in a browser alike. The React hooks and the web components are thin bindings over these same functions.
Variant matrix
Pure functions over aProduct and a VariantSelection (Record<optionId, valueId>). A server can resolve the initial variant and price before anything hydrates.
available means “this combination exists and is not hidden”, not “in stock”. stock.stock is null for shops that do not track inventory, and null means purchasable. Keep unavailable values clickable; selectOptionValue repairs the selection.ProductController
The same logic as a stateful, subscribable object.<ProductProvider> and <qb-product> are both bindings over it.
Images
Never renderimage.path: it is a bare storage filename, not a URL. These helpers build CDN URLs from image.url. See Images.
ProductImageUrlOptions adds baseUrl (a fallback base for a bare path) and cacheBust (default true, appends contentHash as ?v=).
Money
All amounts are minor units. Decimals follow the currency (JPY and ISK have none). Format with the currency the response states (
product.currency, cart.currency), never a constant.
Currencies
See Currencies.CurrencyInfo is on Types.
SEO
See SEO for how to use them.Storage, cookies and runtime
See Storage & SSR.
A
StorageAdapter is any { kind, get(key), set(key, value, { ttlSeconds }), remove(key) }; each method may return a promise. An optional writable: false says writes cannot outlive the request, so a logged-in customer’s session is never renewed through it. createCookieStorage sets it for an accessor without set, createRequestCookieStorage for a jar without collect.
createRequestCookieStorage reads cookies from a Request, a Headers or a raw Cookie header string, and pushes every write as a Set-Cookie string into collect:
Async state
AsyncResource<T> is the framework-free state behind the React catalog hooks: run(operation) aborts the previous run and discards a superseded result, abort(), hydrate(data), subscribe, getSnapshot() returning { data, status, loading, error }.
Campaign storefronts
storefrontRefusal(error) narrows any thrown value to a typed refusal, or null. The shapes are on Errors & scopes. isStorefrontId, isStorefrontSurface, STOREFRONT_ID_PATTERN, STOREFRONT_SURFACES and DEFAULT_STOREFRONT_SURFACE are exported alongside it.
Consent and analytics
The framework-free layer under<ShopkitProvider> and the elements, for a page that composes it itself. The provider and the elements set all of this up by default; see Consent and analytics.
ConsentStore
Bump it to ask every shopper again: a decision stored under an older revision reads as undecided.
false when a third-party consent platform owns the cookie; call save() from its callback.The server’s read. Without it the store reads the cookie;
null starts undecided without reading.document as qb:consent (CONSENT_EVENT) with the state as detail.
Consent helpers
Analytics
Analytics is the hub: it fans GA4-shaped events out to destinations gated on consent, remembers events a destination cannot take yet (consent pending, ids still loading) and drops them on denial.
Destinations
Your own destination is one object implementing
AnalyticsDestination:
Which vendor account it reports to. Lets an inline
destinations array keep the destination across renders without replaying events into it.The category it needs before it receives anything,
load() included. null: always, and it gates itself.Put the vendor’s script on the page. Called once, the first time it is allowed. Must be idempotent.
The purchase, with the id Meta and the platform dedupe it by. Without it, the purchase arrives through
track().Event builders
Pure mappers to GA4’s vocabulary: money in major units,item_id the bare numeric product id, the variant as item_variant.