- Track how users interact with the sidebar.
- Log events for analytics or monitoring.
- Trigger workflows in your own app when specific Adopt events occur.
How to Use
We introduced an event subscription system that allows external applications to subscribe to AdoptAI-specific events emitted on the globalwindow object.This enables you to monitor and handle sidebar interactions (like message loads, tool executions, or user actions) in real time. Paste this code block after the SDK has been booted in your application.
Explanation
The Event Handler
- eventName — a string representing the event type (e.g.
adopt_copilot:message_loaded). - eventData — an object containing the event payload and contextual details.
Subscribing to Events
You can store or forward these events (for example, to analytics tools like Segment or Datadog), or trigger custom actions inside your own app. To clean up, call the function returned by the promise:
Available Events
All event names follow theadopt_copilot:<event> convention.