Skip to main content
You can make your website display a notification bubble when your bot sends a new message. The notification bubble is only displayed if the Webchat window is closed when you receive the message. You can then:
  • Open the notification (by clicking it or pressing Enter / Space)
  • Dismiss the notification (by clicking ×)
  • Open Webchat using the FAB (which dismisses the notification automatically)
You will need:
Since Webchat uses Markdown for rich text in messages, some messages may not render properly in the notification bubble without further processing.

Step 1: Add a Hook to your bot

  1. In the Studio, navigate to the Hooks section.
  2. Select Create Hook and set its type to Before Outgoing.
  3. Paste the following code into the Hook:
This Hook notifies your website every time your bot sends a new message—that way, your website can display a notification bubble.

Step 2: Configure your website

Now, you can configure your website to display the notification bubble.

Add the bubble HTML element

First, add the bubble element somewhere in your website’s HTML:

Add JavaScript

Then, add the following snippet to your website’s JavaScript:
This handles the behaviour of the notification bubble. For example:
  • Displays the message received from the event’s payload
  • Remains visible for 15 seconds before automatically closing
  • Can be selected by clicking or pressing Enter / Space
You can configure the behaviour to suit your needs by modifying the code snippet.

Add CSS

Finally, add this CSS snippet to your website’s stylesheet:
You can modify the styling as needed.
Now, your website will display a notification bubble when your bot sends a new message.
Last modified on June 12, 2026