Events
The Selektable SDK communicates with the widget iframe using the browser’spostMessage API.
You don’t need to handle these events directly. The SDK manages them automatically. This reference is for debugging purposes.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
PostMessage events between the widget and your page
postMessage API.
| Category | Description |
|---|---|
| Lifecycle | Widget loading, opening, and closing |
| Product data | Sending product information to the widget |
| Cart actions | Add to cart, view cart, and checkout interactions |
| Identity | Passing visitor identity to the widget |
window.addEventListener('message', function (event) {
if (
event.data &&
event.data.type === 'widget:modal-close'
) {
// Customer closed the widget
console.log('Widget closed');
}
});
Was this page helpful?