This page is the curated reference. The script tag carries the SDK and the web components, so the generated references at /kit/api/core and /kit/api/elements apply to it too. For a walkthrough, start with Web components setup.
data-* attributes, configures the ambient shop and registers the web components, so the rest of the page is markup.
The bundle
Pin an exact version in the URL and change it deliberately. Load it with
defer to keep it off the critical path.
Attributes
The shop’s
qb_pk_…. Safe in a browser. Omit it and nothing is configured; the page then calls Quickbutik.configure() itself, which is the shape to use when the key comes from a template variable.The currency the page browses in (
EUR) until the shopper picks another with <qb-currency-select> or Quickbutik.setCurrency(); a remembered choice wins over it. Sent with every product, cart and checkout request. Omit it to start in the shop’s own currency. Prices format with the currency each response states, so a single-currency shop needs nothing here. See Currencies.Sell the whole page into one campaign storefront (
sf_…). See Campaign storefronts.Hosted checkout origin. Only for a preview environment or a checkout proxied onto your own domain.
Consent and analytics
The script tag shows a cookie banner and loads the merchant’s own GA4, GTM and Meta pixel once the shopper agrees, by default. Nothing from Google or Meta loads before that. See Consent and analytics.The consent cookie’s domain, for example
.myshop.com to share it across subdomains. Host-only by default.Run analytics ungated, and make the hosted checkout track ungated too. Only for a storefront that owes its shoppers no consent.
Load GTM or gtag.js before the shopper decides, under a Consent Mode default of everything denied. A GTM container loaded this way runs all of its tags.
A key from a server-rendered template
type="module" matters: defer is ignored on an inline script, which would then run before the deferred kit script has defined window.Quickbutik. A module script runs after the deferred scripts before it.
window.Quickbutik
The ambient shop
The ambient shop, or
null when nothing is configured.The whole SDK client. Assignable, to swap in a client you built yourself. Log customers in with
Quickbutik.client.customers.login() (or register them with register()); see Customer accounts.The shared cart store:
subscribe, getSnapshot, load, refresh, add, updateItem, removeItem, clear, buyNow, hydrate. Every cart element updates from it.Same as
configure(). Call it once.Currency
The currency the page browses in: the shopper’s remembered choice, else
data-currency, else null (the shop’s own).Reprice the page: every
qb-product, qb-product-list and cart element reloads in the new currency, the same cart re-read. Remembered for the next visit. null returns to the default. The markup twin is <qb-currency-select>.Resolve a choice against what the shop offers:
{ currency, baseCurrency, mode, rate, chargeCurrency, currencies }. See Currencies.Consent and analytics
The page’s consent decision:
allows(category), acceptAll(), rejectAll(), save(choice), reset(), openSettings(), subscribe(), getSnapshot(). Created with its defaults the first time it is read; the data-consent-* attributes configure it.The ambient shop’s analytics hub, or
null when analytics is off or nothing is configured.Send a commerce event of your own through the hub, for example a
view_item_list on a category page or a page_view on a soft navigation. A no-op with analytics off.Report an order with data of your own (a legacy-checkout shop, a thank-you page that is not
<qb-order-confirmation>). Deduplicated per order in this browser; false when it was already reported.ConsentStore, Analytics, readConsentCookie, appendCheckoutHandoffParams, googleTagDestination and metaPixelDestination are on the global too, for a page wiring its own. See Utilities.
Setup
SDK
Helpers
Recipes
Quickbutik.cart rather than a second client for the cart, or your code and the elements disagree until the next reload.
Content Security Policy
The bundle evaluates no strings (noeval, no new Function, no dynamic imports). With analytics on (the default) it loads the merchant’s own vendors once the shopper agrees, so the policy must allow them too:
script-src names wherever you serve the file from. With data-analytics="false" (or data-consent="false") the vendor hosts can go, and the bundle loads nothing else on its own. frame-src is only needed for the inline checkout, <qb-checkout>. Every tag the analytics layer injects is async and carries data-qb-analytics. The JSON-LD that <qb-seo> writes is data, not code, and no directive governs it.