Skip to main content
Triggered before the view state changes, for example, showing or hiding the launcher, or main window. Use this event to react to or preprocess the upcoming view transition.

Event properties

string
required
Always 'view:pre:change'.
string
required
The reason for the view change, for example, 'launcherClicked', 'chatLoaded', 'calledChangeView', 'mainWindowMinimized'.
object
required
The previous view state.
boolean
Whether the launcher was visible.
boolean
Whether the main window was visible.
object
required
The new view state to apply. It can be modified by the handler.
boolean
Whether the launcher will be visible.
boolean
Whether the main window will be visible.

View change reasons

  • launcherClicked
    User clicked the launcher button.
  • chatLoaded
    Chat loaded for the first time.
  • calledChangeView
    View changed programmatically through the changeView() method.
  • mainWindowMinimized
    User clicked the minimize button.

Example

Do you need practical examples?

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