Skip to main content
Triggered after the conversation restarts, before a new session begins. Use this events for displaying specific UI elements, sending an initial message, or resetting application state when a new session starts.

Event properties

type
string
required
Always 'restartConversation'.

Example

let hasRestarted = false;

instance.on('restartConversation', (event, instance) => {
    console.log('Conversation has restarted');
    
    // Send a welcome message after restart
    if (!hasRestarted) {
        setTimeout(() => {
            instance.send('Hello! I\'d like to start fresh.');
        }, 1000);
        hasRestarted = true;
    }
    
    // Reset application state
    resetAppState();
    
    // Show welcome banner
    showWelcomeBanner();
});

Do you need practical examples?

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