Skip to main content

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.

Destroys the web chat instance and removes it from the page, cleaning up all associated resources and event listeners.

Syntax

instance.destroy();

Parameters

None

Returns

void
Returns a void operator.

Examples

The following examples show different ways to destroy the chat instance:
// Destroy chat when user logs out
const handleLogout = () => {
    instance.destroy();
    // Perform other logout actions
};

// Destroy chat when navigating away
window.addEventListener('beforeunload', () => {
    instance.destroy();
});

Do you need practical examples?

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