1. Embedded
  2. Fullscreen mode via control event

Embedded

Fullscreen mode via control event

Explains toggling embedded Webchat fullscreen mode with control events. Useful for switching between compact and focused chat experiences.

Overview

You can make the embedded webchat enter or exit fullscreen mode by sending a webchat_control_event from your stub. The window.fullscreen boolean determines whether the webchat is displayed fullscreen (true) or returns to its normal windowed size (false).

Usage

Add a webchat_control_event with the _stubber_webchat_embedded_client action to the webchat object in your notification payload. The window.fullscreen boolean controls the fullscreen state.

        {
  "webchat": {
    "sessionuuid": "~~stub.data._incoming_webchat_data.sessionuuid",
    "stubsession": {
      "set_new_with_timeout_hours": 24
    },
    "webchat_control_event": {
      "action": "_stubber_webchat_embedded_client",
      "params": {
        "window": {
          "fullscreen": "~~stub.data.make_fullscreen"
        }
      }
    }
  }
}

      

When this event is received by the embedded webchat client:

  • If fullscreen is true, the webchat expands to fill the entire viewport
  • If fullscreen is false, the webchat returns to its normal embedded size