> ## 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.

# feedback

Triggered when the user interacts with feedback controls on a message. This includes both the feedback buttons (thumbs up and down) and the details popup where the user can submit additional information.

## Event properties

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

<ParamField path="messageItem" type="object" required>
  The message content item for which feedback was provided.
</ParamField>

<ParamField path="message" type="object" required>
  The complete message for which feedback was provided.
</ParamField>

<ParamField path="isPositive" type="boolean" required>
  Whether the feedback is positive (`true`) or negative (`false`).
</ParamField>

<ParamField path="interactionType" type="string" required>
  The type of interaction (`'button'` or `'details'`).
</ParamField>

<ParamField path="text" type="string">
  The text entered by the user (when submitting feedback details).
</ParamField>

<ParamField path="categories" type="array">
  Array of category strings selected by the user (when submitting feedback details).
</ParamField>

### Interaction types

* **`button`**\
  User clicked thumbs up or down button.

* **`details`**\
  User submitted detailed feedback.

## Example

```javascript theme={null}
instance.on('feedback', (event, instance) => {
    console.log('Feedback received:', {
        isPositive: event.isPositive,
        interactionType: event.interactionType,
        text: event.text,
        categories: event.categories
    });
    
    // Handle button click
    if (event.interactionType === 'button') {
        console.log(`User gave ${event.isPositive ? 'positive' : 'negative'} feedback`);
        
        // Show thank you message
        showNotification('Thank you for your feedback!');
    }
    
    // Handle detailed feedback submission
    if (event.interactionType === 'details') {
        console.log('Detailed feedback:', {
            text: event.text,
            categories: event.categories
        });
        
        // Send to analytics or backend
        submitFeedback({
            messageId: event.message.id,
            isPositive: event.isPositive,
            text: event.text,
            categories: event.categories,
            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>
