Everything else in these docs is payload detail or recipes for those three knobs.
Install
data-hemsy-selector becomes a launcher. With no extra attributes, clicking it opens Sandbox mode — the full interactive experience, starting blank.
Use a shared class selector like .hemsy-launcher when multiple elements should open Hemsy. Avoid reusing the same id on multiple elements.
Launchers are bound when the script loads. Elements added to the page later
(for example by client-side rendering after load) will not automatically
become launchers — use the JavaScript API for
dynamic elements.
Script attributes
Event callbacks (
onItemAdded, onItemRemoved, onProductVariantData) are configured on window.HemsyEmbedConfig, not as data attributes — see Checkout vs Cart.
Rules worth knowing up front
- Prefer
data-hemsy-actionfor checkout vs cart. The legacydata-hemsy-mode="cart"still works for backward compatibility, butdata-hemsy-modeshould be reserved for"instant". data-hemsy-triggeris not a supported attribute. If you see it in old snippets, replace it with adata-hemsy-selectormatch plus the appropriate launcher attribute.
Where to go next
Launch modes
Sandbox, product context, Bundle, Share, Flow, and Instant — and which one
wins when a launcher has multiple attributes.
Checkout vs Cart
Decide what the final CTA does, and sync Hemsy with your own cart state.
JavaScript API
Open and close Hemsy programmatically with
window.HemsyEmbed.Deep Links
Payload schemas, bundle attributes, and URL encoding shared by embeds and
hosted links.