Listen to widget events and integrate with your application
// Listen for widget events
window.addEventListener('aiworkers:widget:opened', (event) => {
console.log('Widget opened', event.detail)
// Track analytics, show notifications, etc.
})
window.addEventListener('aiworkers:appointment:scheduled', (event) => {
console.log('Appointment scheduled', event.detail)
const { appointmentId, scheduledAt } = event.detail
// Sync with your calendar, send confirmation, etc.
}){
"type": "appointment:scheduled",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"appointmentId": "uuid",
"scheduledAt": "2025-01-20T14:00:00Z",
"customerName": "John Doe"
}
}