Event properties
Always
'receive'.The agent’s response that was rendered.
Example
Do you need practical examples?
Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
'receive'.instance.on('receive', (event, instance) => {
console.log('Message received:', event.message);
// Hide typing indicator
hideTypingIndicator();
// Auto-scroll to latest message
instance.doAutoScroll();
// Log to analytics
analytics.track('message_received', {
messageId: event.message.id,
timestamp: Date.now()
});
});