Event properties
Always
'pre:restartConversation'.Example
Do you need practical examples?
Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
'pre:restartConversation'.instance.on('pre:restartConversation', (event, instance) => {
console.log('Conversation is about to restart');
// Show confirmation dialog
const confirmed = confirm('Are you sure you want to start a new conversation?');
if (!confirmed) {
// Note: You cannot prevent the restart, but you can perform cleanup
return;
}
// Save current conversation state
saveConversationState();
// Clear any pending operations
clearPendingOperations();
});