Events (for API)
Last updated
Last updated
Events allow external communication with a project by adding to interactions, enabling connections between the project and external environments.
Events enable cross-communication with a website through the Model API:
Send information to triggers by
Listen from actions by subscribing to events
Events are configured in (Interact mode) and can be added to and :
When used in triggers, they function as listeners
When used in actions, they function as dispatchers
This enables bidirectional data exchange, allowing a model embedded on a site to send information externally and react to incoming data.
Event names must be unique - duplicate event names are not allowed, even across different types
Events can be used in actions for dispatching and transmitting data.
Debugger also displays variable values and changes.
Debugger tab appears in Preview mode if at least one event exists.
Once an event is created, the embed code in the Share popup includes a script
(in addition to the standard iframe
). This script should be added to the site for dispatching and listening to events.
The script includes the following information:
Registering of Event Listeners based on the events used in actions
, with placeholder values
To update the code, synchronize the project in Share popup
Events can be used in triggers. If an event with a matching name
is dispatched (either from an action or the ), it activates the trigger within its .
To transmit a specific value, use a with the same name as the event
Debugger enables event dispatching within Studio, simulating external API calls from the . Enter a value and activate it by clicking the radio button.
of the API
based on the events used in triggers
, with placeholder callbacks
For further details, refer to the .