1. Advanced Configuration
  2. Heimdall Routing

Advanced Configuration

Heimdall Routing

Explains Heimdall routing for Webchat events. Useful for connecting browser lifecycle events and messages to Stubber actions.

  • Heimdall lets you listen to events from all webchat clients.
  • Webchat data from heimdall is placed in stub.data.heimdall.webchat.
  • Multiple events are available; the most important is firstmessage, which fires when a user sends a webchat message.
  • Create the heimdall registration stubber.systems.notifications.webchat.org.{{stub.orguuid}}.name.new_webchat_profile.webchatmessagetype.firstmessage

Emit Types

Event Trigger Description
Initialize Chat window opens Fires when a user opens the webchat window. Use this to capture the session UUID and optionally send a welcome message.
First Message User's first message Fires when a user sends their very first message in a session.

Initialize

When a user opens the chat window, an event is emitted on this Heimdall path:

stubber.systems.notifications.webchat.org.{{orguuid}}.name.{{chatname}}.webchatmessagetype.initialize

Any Stub registered on this path will receive the following payload:

Initial Payload
        "heimdall": {
  "webchat": {
    "sessionuuid": "23532740-07df-4628-af83-43db12c8f4ad",
    "webchat_configuration": {
      "orguuid": "96305d53-2fb0-512d-9d59-3f2b03aa679a",
      "chatname": "documentationexample",
      "passthroughData": "{'some':'data'}"
    }
  }
}

      

This message gives the stub the session uuid of the new user. You can use the session uuid to send a message before the user responds.

First Message

When a user sends their first message, an event is emitted on this Heimdall path:

stubber.systems.notifications.webchat.org.{{orguuid}}.name.{{chatname}}.sessionuuid.{{sessionuuid}}.webchatmessagetype.firstmessage

Any Stub registered on this path will receive the following payload:

Client message payload
        "heimdall": {
  "webchat": {
    "sessionuuid": "23532740-07df-4628-af83-43db12c8f4ad",
    "webchat_message": {
      "type": "text",
      "value": "user message"
    },
    "webchat_configuration": {
      "orguuid": "96305d53-2fb0-512d-9d59-3f2b03aa679a",
      "chatname": "documentationexample",
      "passthroughData": "{'some':'data'}"
    }
  }
}