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-keyis your market’s publishable key, from Settings › Publishable keys. Use thepk_test_key while you build: it also works onlocalhost, and its plays are never billed. Switch topk_live_when you go live; it only works on your market’s allowed domains.experienceis 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.
Build your snippet
Section titled “Build your snippet”Fill in your key and widget, and copy the result. It’s made by the same code as the console’s Embed button.
Element attributes
Section titled “Element attributes”| 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.
Product pages
Section titled “Product pages”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>When a widget can’t show
Section titled “When a widget can’t show”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.
Browser support
Section titled “Browser support”iOS Safari 16.4 or later, and current Chrome, Edge, Firefox and Safari. On older browsers the widget stays hidden and reports unsupported-browser.