1. Load the event client
Include/Events.js from the Neuron so the page receives a tab ID and maintains its event channel. When the page and API use different hosts, declare the event server in the page metadata as required by that deployment and configure the Agent client host with AgentAPI.IO.SetHost(host, secure).
Cross-origin deployments also need correct CORS, cookie, and TLS configuration. Do not relax origins globally to make the event channel work.
2. Register a handler
After the event client has assigned a tab ID, register the most specific match you need:function names the browser callback. Leaving it empty unregisters that match.
3. Design for disconnects
- register again when a page reloads or receives a new tab ID;
- make handlers idempotent because reconnect races can cause repeat work;
- poll Pop messages after reconnect when missing a message is unacceptable;
- use the narrowest local-name, namespace, and stanza-type match;
- unregister handlers no longer needed by sending the same selector with an empty
function.
The older documentation called this a webhook. It is a browser event bridge tied to a Neuron session and tab, not a public callback URL.