You will need:
- A website with an embedded bot
- Basic familiarity with JavaScript
On any visit to your website
To open Webchat every time a user visits your website, add the following script to your website’s source code:index.js
On visits with a specific link
You can also use a URL hash (#) to create a custom link that opens Webchat automatically on your website. For example:botpress.com/docs
: Opens the Botpress documentationbotpress.com/docs#ask
: Opens the Botpress documentation, then opens Webchat
index.js
#ask
hash. You can change the hash itself to anything you like.
Limitation when manually initializing Webchat
If you’re manually initializing Webchat, make sure you execute either of the code snippets above before you callwindow.botpress.init
:
index.js