Use the saved embed from Install. The page supplies only the product or location keys it needs. An omitted type defaults to where-to-buy; an empty, unknown or retired type renders nothing.
<script
src="https://cdn.test.stockisto.com/widget.js"
data-api-base="https://api.test.stockisto.com"
data-embed="we_0123456789abcdef0123456789abcdef"
data-sku="7130171"
async
></script>
01The eight widgets
| Widget | Placement | Keys | Widget page |
|---|---|---|---|
where-to-buy | A brand product page; shops near the shopper | data-embed, data-sku | Where to buy |
guided-handoff | A brand product page; retailer and installer handoff | data-embed | Installer finder |
store-locator | A brand page; network map or list | data-embed | Store locator |
installer-finder | A brand page; approved installers | data-embed | Installer finder |
store-availability | A retailer product page; stock by branch | data-stockisto-slug, data-retailer, data-sku | Store availability |
store-card | A store page; address, hours, brands and rating | data-store-id, data-retailer | Store card |
installer-card | An installer site; credential and coverage | data-installer, data-stockisto-slug | Installer card |
stock-alert | A retailer product page; back-in-stock email | data-stockisto-slug, data-store-id, data-sku | Stock alert |
| Attribute | Values or default |
|---|---|
data-widget-type | where-to-buy, guided-handoff, store-locator, installer-finder, store-availability, store-card, installer-card, stock-alert, (where-to-buy) |
data-view | full, inline, button, pill, corner, map, list, (full) |
02Products
One product code, up to 100 characters. An unknown code shows a not-found state, never brand-wide results. data-skus takes up to 6 comma-separated codes.
| Attribute | What it does |
|---|---|
data-sku-type | The kind of code in data-sku. rsk, gtin, enummer, mpn, sku, vvs, nrf, lvi, retailer_sku, nobb, finfo, efo, elnummer_dk, sahkonumero, tun, ean |
data-sku | One product code, up to 100 characters. |
data-skus-type | The kind of code in data-skus. rsk, gtin, enummer, mpn, sku, vvs, nrf, lvi, retailer_sku, nobb, finfo, efo, elnummer_dk, sahkonumero, tun, ean |
data-skus | Up to 6 comma-separated product codes. |
03Location and list
A fixed data-lat and data-lng search centre prevents a browser location prompt. data-radius is in kilometres. data-per-view controls rows in the inline view.
| Attribute | Default | What it does |
|---|---|---|
data-lat | Fixed search latitude. -90–90 | |
data-lng | Fixed search longitude. -180–180 | |
data-radius | 50 | Search radius in kilometres. >= 0 |
data-filter | Filter stock or retailer status. confirmed, showroom, authorized | |
data-rank | stock | Order the results. stock, distance, price |
data-channel | all | Choose the sales channel. all, near, online |
data-prices | retailer | Choose which prices to show. retailer, online, msrp, off |
data-audience | consumer | Choose the customer audience. consumer, trade |
data-quantity | Required quantity. 1–9007199254740991 | |
data-reserve | false | Enable reservations. |
data-guided | false | Enable guided questions. |
data-per-view | 3 | Rows before showing all. 1–12 |
data-jsonld | on | Include structured data. on, off |
data-map-height | 480 | Map frame height in pixels. 320–800 |
04Styling
data-theme and the colour overrides take hex colours. data-width accepts full or 200 to 2000 pixels. The browser supplies the font; no web font is loaded.
| Attribute | Values or default |
|---|---|
data-theme-preset | light, heritage, dark, blue, copper, fjord, oak, signal, graphite, (heritage) |
data-radius-scale | sm, md, lg, (md) |
data-density | spacious, cozy, compact, dense, (cozy) |
data-shadow | soft, flat, none, (soft) |
data-font | grotesk, sans, serif, mono, system, (grotesk) |
data-theme | (#1e5e45) |
data-theme-accent2 | Second accent, hex colour. |
data-theme-surface | Card surface, hex colour. |
data-theme-ink | Text colour, hex colour. |
data-width | Full width or 200 to 2000 pixels. |
05Language and consent
| Attribute | Values or default |
|---|---|
data-analytics-consent | Only the literal true sends analytics. Leave it off until consent is given. |
data-lang | en, sv, nb, da, fi, (en) |
Without data-lang, the widget follows the page language, then the browser, then English. Only the literal true in data-analytics-consent enables analytics.
06Content Security Policy
| CSP | TEST | For |
|---|---|---|
| script-src | https://cdn.test.stockisto.com | Every widget |
| connect-src | https://api.test.stockisto.com | Every widget |
| style-src | 'unsafe-inline' | Every widget |
| img-src | https://api.test.stockisto.com | Every widget |
| frame-src | https://find.test.stockisto.com | Store locator and installer finder |
07Boot errors
data-stockisto-error | What to check |
|---|---|
unknown-widget-type | data-widget-type |
embed-unavailable | data-embed, data-api-base |
missing-data-source | data-embed, data-stockisto-slug |
unknown-brand-slug | data-stockisto-slug |
pill-target-locator-without-brand-slug | data-stockisto-slug |
08Analytics events
With consent, the widget posts events to /api/v1/analytics/events without credentials. The API answers 202. Account attribution requires the page’s domain in Allowed origins.
Seller action events
The event is retailer_cta_click, with widgetEvent cta_click and ctaType call, directions or website.
A quote link that opens a phone number or a website counts as a call or website action.
09Install from npm
Not live yet. The local package is version 2.10.4 with ESM, CommonJS and TypeScript types. npm installation is unavailable until publication is verified. Use the script tag above.
import {
readConfig,
fetchRetailers,
mountStoreListWidget,
} from "@stockisto/widget";
const script = document.createElement("script");
script.dataset.apiBase = "https://api.test.stockisto.com";
script.dataset.stockistoSlug = "your-brand-slug";
script.dataset.sku = "7130171";
const config = readConfig(script);
const { rows } = await fetchRetailers(config, new AbortController().signal);
const container = document.getElementById("where-to-buy");
if (container) mountStoreListWidget(container, rows, config);
| Widget | npm |
|---|---|
where-to-buy | mountStoreListWidget, mountPdpWidget, mountWhereToBuyButton, mountPillWidget, mountCornerWidget |
store-locator | mountStoreLocatorWidget(container, config) |
installer-finder | mountInstallerFinderWidget |
store-availability | mountStoreAvailabilityWidget(container, config, rows) |
store-card | mountStoreCardWidget, storeCardParts |
installer-card | mountInstallerCardWidget |
guided-handoff | renderGuidedHandoff |