You can customize the webchat look and behavior using options documented below.

Parameter Default Description Type
appToken - String Required. Your app’s appToken. You can find it in the HTML snippet on the webchat page of your app or on the app edition page on the Botfuel Developer Portal.
size {width: 400, height: 500} Object Size of the webchat window
startOpen false Boolean Start with the dialog open or not
startFullScreen false Boolean Start fullscreen
embeddedContainerId "" String Embed the dialog inside the page instead of at the bottom right. Disables the startButton and forces startOpen to true
theme See hereunder Object See Theme object
labels See hereunder Object See Labels object
menuActions See hereunder Array See Menu actions array
voiceEnabled false Boolean Whether speech to text is enabled

To receive and send messages, you must:

  • Create an app on Botfuel developer portal, tick the Botfuel Webchat option when selecting your app’s plan;
  • Configure the Webchat for your app:

    • Set an endpoint that will receive a POST request for each user message (i.e. https://mybot.io/webhook - consider using software like ngrok for testing purposes)
    • Set allowed origins: URLs that are allowed to use the webchat client and communicate with your bot
  • Add our script to any page (NB: domain should be listed in Allowed origins)
  • Post bot messages to users via the webchat endpoint:

<APP_TOKEN> is the appToken you set in the webchat script.
<USER_ID> is generated client-side and sent to your bot on each user message.