Skip to main content
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

type
string
required
Always 'feedback'.
messageItem
object
required
The message content item for which feedback was provided.
message
object
required
The complete message for which feedback was provided.
isPositive
boolean
required
Whether the feedback is positive (true) or negative (false).
interactionType
string
required
The type of interaction ('button' or 'details').
text
string
The text entered by the user (when submitting feedback details).
categories
array
Array of category strings selected by the user (when submitting feedback details).

Interaction types

  • button
    User clicked thumbs up or down button.
  • details
    User submitted detailed feedback.

Example

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()
        });
    }
});

Do you need practical examples?

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