Skip to main content
Triggered after the chat sends a message to the agent. Use this event for analytics, logging, or triggering side effects after a message is dispatched.

Event Properties

type
string
required
Always 'send'.
message
object
required
The message payload that was sent to the agent.

Example

instance.on('send', (event, instance) => {
    console.log('Message sent:', event.message);
    
    // Log to analytics
    analytics.track('message_sent', {
        content: event.message.message.content,
        timestamp: Date.now()
    });
    
    // Show typing indicator
    showTypingIndicator();
});

Do you need practical examples?

Learn how to apply the features available for embedded chat into your implementation with guidance and examples.