theme.liquid) if you’d rather edit the theme yourself, or to any other page where you own the markup.
Prefer not to touch code? The theme app extension places
this same script for you from the theme editor.
Install
data-hemsy-selector becomes a launcher. With no extra attributes, clicking it opens Sandbox mode: the full interactive experience, starting blank. What each launcher opens, and what its final CTA does, is controlled by launcher attributes.
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. One exception: the script re-scans for launchers on
Shopify’s
shopify:section:load event, so theme editor re-renders keep
working.Script attributes
Event callbacks (
onItemAdded, onItemRemoved, onProductVariantData) are configured on window.HemsyEmbedConfig, not as data attributes. See Checkout vs Cart. Without the native cart strategy, onProductVariantData is how returned items reach your cart.
Rules worth knowing up front
- Launch mode and the final action are per launcher: set
data-hemsy-share,data-hemsy-flow,data-hemsy-auto-product-context, ordata-hemsy-actionon a launcher element to affect just that button.data-hemsy-actionon the script tag acts as the page-wide default. - Prefer
data-hemsy-actionfor checkout vs cart. The legacy script-leveldata-hemsy-mode="cart"still works for backward compatibility. data-hemsy-triggerhas no launcher semantics of its own. It’s the conventional selector hook (data-hemsy-selector="[data-hemsy-trigger]"), which is what the Shopify theme extension uses by default.