Skip to main content
Updates the chat UI view by showing or hiding the launcher, main window, or both. Use this method to programmatically control the visibility of chat components.

Syntax

await instance.changeView(viewUpdate);

Parameters

viewUpdate
string | object
required
Either a string key (‘launcher’ or ‘mainWindow’) or an object with optional launcher or mainWindow, or both boolean properties to control their visibility.

Returns

Promise<void>
Returns a promise that resolves when the view is updated.

Examples

The following examples show different ways to update the view:
// Show the main window and hide the launcher
await instance.changeView({ launcher: false, mainWindow: true });

// Toggle just the launcher
await instance.changeView({ launcher: true });

// Use string shorthand to show main window
await instance.changeView('mainWindow');

Do you need practical examples?

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