> ## Documentation Index
> Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# receive

Triggered after the chat receives a response from the agent and the response renders in the UI. Use this event for post-processing, analytics, or triggering follow-up actions.

## Event properties

<ParamField path="type" type="string" required>
  Always `'receive'`.
</ParamField>

<ParamField path="message" type="object" required>
  The agent's response that was rendered.
</ParamField>

## Example

```javascript theme={null}
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()
    });
});
```

<Card title="Do you need practical examples?" icon="text-align-start" href="https://www.ibm.com/docs/SSAVQO/deploy/web_chat_agent/tutorials/tutorials_lp.html" arrow="true" cta="Learn with walk-throughs" horizontal>
  Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
</Card>
