Embedding the widget
Where the widget sits on your page, which one you create, and where its settings come from. Everything here is independent of what you do with a finished scan, which is events and, if you keep your own scan data, bring your own storage.
Inline is embedded
Inline mode mounts the widget into your page via container. No floating toggle button is used in inline mode.
autoOpen
autoOpen controls whether the widget surfaces on init. In float mode the launcher is always shown — autoOpen: false just keeps the widget closed until the user clicks the launcher (or you call open()). In inline mode, false defers mounting entirely.
User is optional
If you don’t have user context (public page), omit user. The widget can prompt for an email when needed.
Modes (float vs inline)
Float mode
Create the widget with mode: "float". The floating launcher appears automatically on every embed. autoOpen: true (default) also opens the widget itself immediately; autoOpen: false leaves just the launcher, and the widget opens on click or when you call open().
<!-- 1) Load the widget bundle (UMD) -->
<script src="https://sandbox.widget-lib.oysterskin.com/v1/oysterskin-vendor-widget-web.umd.js"></script>
<!-- 2) Create a widget instance -->
<script>
const instance = OysterskinWidget.createScanWidget({
publicKey: "YOUR_PUBLIC_KEY",
mode: "float",
autoOpen: true,
callback: (message) => {
console.log("Oyster widget message", message);
},
});
// Float mode: the launcher appears on its own. autoOpen also opens the panel.
</script>
Inline mode
Create the widget with mode: "inline" and provide a container. Inline mode mounts into your page and does not use a floating launcher.
<!-- 1) Load the widget bundle (UMD) -->
<script src="https://sandbox.widget-lib.oysterskin.com/v1/oysterskin-vendor-widget-web.umd.js"></script>
<!-- 2) Add a mount container -->
<div id="widget-root"></div>
<!-- 3) Create a widget instance -->
<script>
const instance = OysterskinWidget.createScanWidget({
publicKey: "YOUR_PUBLIC_KEY",
mode: "inline",
container: "#widget-root",
inlineHeight: 720,
autoOpen: true,
callback: (message) => {
console.log("Oyster widget message", message);
},
});
// Inline mode: mounts into the container as soon as it is created.
</script>
Widget types
- Scan: createScanWidget
- Chat: createChatWidget
- Unified: createUnifiedWidget
- Consultation: createConsultationWidget
- Voice Agent: createVoiceAgentWidget
Unified widget: programmatic navigation
On a unified widget instance you can jump directly to any tile from host code. Each method opens the widget (if minimized) and navigates it to that view.
const widget = OysterskinWidget.createUnifiedWidget({ /* ... */ });
widget.openScan();
widget.openConsultation();
widget.openChat();
widget.openVoiceAgent();
These methods are present on every widget instance, but on a restricted widget (e.g. createScanWidget) the widget silently ignores navigation to disallowed views.
Unified widget: restricting the gallery
Pass widgetTypes to show only specific tiles in the home gallery. The router also blocks deep-linked routes outside the listed types.
const widget = OysterskinWidget.createUnifiedWidget({
publicKey: "YOUR_PUBLIC_KEY",
widgetTypes: ["scan", "consultation"], // hide chat + voice-agent tiles
callback: (message) => console.log(message),
});
Vendors can also configure this list centrally from the Oyster widget manager — no host code change required. When widgetTypes is passed from code it overrides the vendor-managed value.
Where config comes from
Most appearance and copy options can be set centrally from the Oyster Widget Manager in the vendor dashboard and are fetched at runtime. The recommended workflow:
- Set your branding, copy, and budget tiers once in the Widget Manager — no deploy required, every embed picks them up.
- From code, pass only what's page-specific or what you need to override for a particular widget instance. Anything you pass from code wins; anything you omit falls back to the manager-saved value.
Manager-controlled options
Set these in the Widget Manager; override per-instance from code only when needed.
- primaryColor, primaryTextColor
- displayLogo, logoUrl
- introMessage, messageBody
- budgetRanges, budgetCurrency
- conversationStarters (chat / unified)
- widgetTypes (unified — restrict the home gallery)
- launcherPosition (float — which corner the launcher sits in, and how far from the edges)
- zIndex (float: the stacking order the widget paints at)
- language (the language the widget speaks to shoppers)
- Allowed domains
Code-only options
No manager equivalent — these are per-page or per-instance decisions.
- publicKey, callback — required on every instance
- vendor: required with a partner key, see Embedding for a business you manage
- mode, container, inlineWidth, inlineHeight — page-specific layout
- autoOpen, displayHoverPopup, displayAutoPopup — per-instance UX behaviour
- user — per-end-user context
In short: configure once in the Widget Manager; reach for code overrides only when an instance needs to differ.
Finishing a scan your server started
When your server starts a hosted scan, the response carries both a url and a reference. Send the client to the url, or keep them on your page and open the scan in a modal with the reference:
const scan = OysterskinWidget.openHostedScan({
reference: 'hs_...', // from your server's response
onScanCompleted: ({ batch_id, reference }) => { /* photos analysed */ },
onRecommendationReady: ({ batch_id, reference }) => { /* product routine ready */ },
onClose: () => { /* modal closed, however it closed */ },
});
// Later, to dismiss it yourself:
scan.close();
- reference (required): the hosted scan to finish. No widget key is needed on the page.
- consent (default true): shows Oyster's consent screen before the photos are analysed. Set it to false only when your page has already collected the client's consent to the analysis.
- onScanCompleted, onRecommendationReady: called with { batch_id, reference }.
- onClose: called once, whether the client closed the modal or you called close().
- zIndex: the stacking order the modal paints at.
A scan started with mode: "redirect" does not leave your page when it is opened this way. The modal shows that the scan is complete, and your page decides where the client goes next.
Framework patterns
Recommended: load the UMD script once, keep one widget instance, and reuse it. In inline mode, mount into a stable container.
Embedding inside an iOS or Android app works the same way, with a host page of your own in a WebView. See Embedding the widget in a mobile app.
On Shopify the Oyster app adds the widget from your theme editor. See Setting up Oyster on Shopify. For any other store, including the cart handoff and order reporting, see Connect any store.
On WooCommerce there is nothing to load by hand: the plugin handles the keys, the allowed domains and the placement for you. See Setting up Oyster for WooCommerce.
Advanced patterns
For inline mode, use autoOpen: false + call open() from your CTA to defer the widget entirely and improve page performance. (In float mode the launcher is always shown, so autoOpen: false just keeps the widget itself closed — it doesn't avoid loading the launcher.)