Options
| Key | Arguments | Description | Example |
|---|---|---|---|
on_url_change | (page: {hostname: string; url: string}) | Fired on each call for the reload method. | on_url_change: (page) => console.log(page) |
on_socket | (event: {event: string; time: number}) | Fired on socket lifecycle events (channelJoin, joinChannelError, unmonitor, onError). | on_socket: (e) => console.log(e) |
on_autocapture | (element: Element, type: string) | Fired when an auto-captured event occurs (click, submit, change). | on_autocapture: (el,t) => console.log({el,t}) |
Example: Handling Callbacks
Type definitions
Troubleshooting
- “My callback doesn’t fire” – Ensure the SDK is initialized with
callbacksdefined before events occur. - “Socket events not showing” – Verify network connections and channel join logic.
- “Autocapture callback too noisy” – Combine with
excluded_elementsormasked_elementsto reduce unwanted triggers.