The Webchat is a widget that you can add to your website to allow your users to interact with your chatbot. It's a great way to provide support to your users and answer their questions.

Prerequisites

Setting up the Webchat integration in Botpress

  1. Go to the Integration Hub in Botpress Cloud (if you don't have the integration installed yet).
  2. Find and open the Webchat integration then click on the "Install to Bot" button, now go back to your bot.

Setting up the Webchat

Pre-configured Script

Shareable URL

You can share your chatbot with people that would like to quickly test your chatbot using the Shareable Link.

Embedded Script

This script will add the webchat to your website. You can copy the script and paste it in the <body></body> tag of your HTML page.
This is the recommended way of adding the webchat to your website.

Configurable Script

The configurable webchat code must be updated manually every time there is a change. We highly recommend using the Pre-configured version.

Copy the code from the Configurable tab and paste it in the <body></body> tag of your HTML page.

Configurable Script Parameters

You can customize the webchat by changing/adding the values of the parameters in the script.

ParameterDescriptionDefault valueparameter type
stylesheetProvide a path to a stylesheet to customize the webchat-string
showConversationsButtonIf false, will hide the conversation list panetrueboolean
showTimestampIf true, will display a timestamp under each messagesfalseboolean
enableTranscriptDownloadAllows the user to download the conversation historytrueboolean
enableConversationDeletionAllows the user to delete its conversation historyfalseboolean
closeOnEscapeClose the webchat when pressing the Esc keytrueboolean
botNameDisplays the bot name to the right of its avatar-string
composerPlaceholderAllows to set a custom composer placeholder'Reply to {botname}'string
avatarUrlAllow to specify a custom URL for the bot's avatar-string
localeForce the display language of the webchat (en, fr, ar, ru, etc..)
Defaults to the user's browser language if not set
Set to 'browser' to force use the browser's language
'browser'string
botConversationDescriptionSmall description written under the bot's name-string
hideWidgetWhen true, the widget button to open the chat is hiddenfalseboolean
disableAnimationsDisable the slide in / out animations of the webchatfalseboolean
useSessionStorageUse sessionStorage instead of localStorage, which means the session expires when tab is closedfalseboolean
containerWidthSends an event to the parent container with the width provided360string OR number
layoutWidthSets the width of the webchat360string OR number
enablePersistHistoryWhen enabled, sent messages are persisted to local storage (recall previous messages)trueboolean
classNameCSS class to be applied to iframe-string
disableNotificationSoundIf true, chat will no longer play the notification sound for new messages.falseboolean
googleMapsAPIKeyGoogle Maps API Key required to display the map. It will display a link to Google Maps otherwise.-string
websiteDisplays the bot's website in the conversation page-string
phoneNumberDisplays the bot's contact phone number in the conversation page-string
termsConditionsDisplays the bot's terms of service in the conversation page-string
privacyPolicyDisplays the bot's privacy policy in the conversation page-string
emailAddressDisplays the bot's email address in the conversation page.-string
coverPictureUrlDisplays the bot's cover picture in the conversation page-string
showBotInfoPageEnables the bot's information page in the webchatfalseboolean
showCloseButtonDisplay's the webchat close button when the webchat is openedtrueboolean
userDataPasses the user data to the bot-object
customUserPasses the custom user data to the bot-object

Domain Whitelisting

💼

Team Plan

This feature is only available to Team plan subscribers.

The domain whitelisting feature ensures that only approved domains can host and utilize the chatbot. This enhances security and control, ensuring that your chatbot is only available on trusted websites.

Configuring Allowed Origins

  1. Navigate to the Webchat integration settings on your Dashboard
  2. Expand the 'Advanced Settings' menu
  3. To add a domain (or an allowed origin), type the domain name in the provided field. You can provide multiple allowed origins or whitelisted domains.

Make sure to save the configuration after you've indicated which domains you want to whitelist.

Customizing/Controlling the Webchat

For more information on customizing the webchat, please refer to the Webchat developer documentation.