-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi team,
I'm currently trying to add the widget to onea of websites using raw HTML, all is working fine but events :)
So currently attaching events this way is not logging anything:
<html>
<body>
<!--StartFragment-->
<script>
--
document.addEventListener('DOMContentLoaded', function() {
const widget = document.querySelector('vapi-widget');
// Listen for call events
widget.addEventListener('call-start', function(event) {
console.log('Voice call started');
// Track analytics, update UI, etc.
});
widget.addEventListener('call-end', function(event) {
console.log('Voice call ended');
// Update UI, save conversation, etc.
});
widget.addEventListener('message', function(event) {
console.log('Message received:', event.detail);
// Process message, update state, etc.
});
widget.addEventListener('error', function(event) {
console.error('Widget error:', event.detail);
// Handle errors, show fallback UI, etc.
});
});
</script>
<!--EndFragment-->
</body>
</html>
Metadata
Metadata
Assignees
Labels
No labels