Event properties
Always
'restartConversation'.Example
Do you need practical examples?
Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
'restartConversation'.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();
});