Skip to content

Embed a widget

A widget is two lines of HTML: the loader script, once per page, and a <lumieo-experience> element where the widget goes. The console writes both for you under Web › Widgets when you open a widget and choose Embed.

<script
type="module"
src="https://cdn.loomieo.com/v1/loader.js"
data-key="pk_live_…"
async
></script>
<lumieo-experience
experience="WIDGET_ID"
style="display:block;height:var(--lumieo-launcher-height,300px)"
></lumieo-experience>
  • data-key is your market’s publishable key, from Settings › Publishable keys. Use the pk_test_ key while you build: it also works on localhost, and its plays are never billed. Switch to pk_live_ when you go live; it only works on your market’s allowed domains.
  • experience is the widget’s id. The same widget can appear more than once on a page.
  • The inline style reserves the widget’s height before anything loads, so your page never jumps. Keep it. The console’s snippet already has the right height for the widget’s format; floating bubbles use height:0.

Fill in your key and widget, and copy the result. It’s made by the same code as the console’s Embed button.

Attribute Required What it does
experience Yes The widget to show. Changing it loads the new widget.
key No A publishable key for this element only. Overrides the script’s data-key.
product No The product on this page, by your shop’s product id. Widgets with the product page filter show only videos tagged with it, and hide when there are none.
locale No The player’s language, such as sv or en.
view-state Read only What the widget is doing: loading, idle, open, floating or hidden. Use it in your CSS, for example lumieo-experience[view-state="hidden"] { display: none }.

You can also override the widget’s look per page with attributes such as card-style and CSS variables such as --lumieo-brand. What you set on the page always wins over the widget’s theme.

To show only the videos for the product on the page, turn on the product page filter on the widget, then fill product from your shop’s template. In Shopify Liquid:

<lumieo-experience
experience="WIDGET_ID"
product="{{ product.id }}"
style="display:block;height:var(--lumieo-launcher-height,300px)"
></lumieo-experience>

If a widget can’t load, the element hides itself (display: none), sets view-state="hidden" and sends a lumieo:error event. The errors page explains every code.

iOS Safari 16.4 or later, and current Chrome, Edge, Firefox and Safari. On older browsers the widget stays hidden and reports unsupported-browser.