window.HemsyEmbed. The embed script must be loaded on the page. Either install path works, since the theme extension and the script install load the same script.
The API uses the original mode identifiers:
"scratch" is Sandbox mode and
"closet" is Bundle mode.Opening
action in the payload overrides the page-level data-hemsy-action for that open only.
Closing
Configuration with HemsyEmbedConfig
window.HemsyEmbedConfig is the JavaScript alternative to script-tag data attributes, and the only place to register event callbacks. Define it before the embed script loads:
When the same setting appears both on
HemsyEmbedConfig and as a script-tag
data attribute, the script attribute wins. Keep each setting in one place
to avoid surprises.