Send custom events and messages from your web app to webchat

With the webchat initialized on your web application, you can send custom events to your bot and programmatically send messages on behalf of the user.

Sending Custom Events to Your Bot

You can send custom events to your bot by calling the following code, where customPayload is a JSON object:

await window.botpress.sendEvent(customPayload)

These events can be captured using the “Custom Trigger” card in Botpress Studio, and the payload can be accessed via event.payload.


Sending Messages from Your Web Application

To send messages directly to your bot from your web application, use the following method:

await window.botpress.sendMessage('custom message')

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy