Skip to content

Adding DocBot Modal to a webpage

DocBot is also available as an embeddable modal widget compatible with any web application. It maintains full feature parity with the standalone version, ensuring users have access to all functionalities.

docbot_modal.png

Integration Guide

Follow the steps below to integrate the DocBot widget into your webpage.

  1. Include the SDK. : Add the following script tag to the or of your project's index.html file
<link rel="stylesheet" href="https://docbot-64c680.gitdocs.ebi.ac.uk/dist/Chatbot-Modal.css">
<script src="https://docbot-64c680.gitdocs.ebi.ac.uk/Chatbot-Modal.web.js" type="module"></script>
  1. Add the widget component : Place the following custom element anywhere within the of the webpage where you want the widget to be available
<docbot-modal
  selectedteam="ena"
  backendurl="https://www.ebi.ac.uk/docbot/api"
>

Note

If your application is not hosted on ebi.ac.uk, please contact us to have your domain added to the CORS allowed origins before embedding the widget.

Configuration Options

You can customize the element using the following attributes:

Attribute Description Default Example
selectedteam Pre-selects the team context when the widget loads. all_services selectedteam="ena"
backendurl Defines which environment the widget connects to. — See environment list below
enableselector When set to false, hides the team dropdown and locks the widget to the team set by selectedteam (or all services if none is specified). true enableselector="false"

Environment

Set the backendurl attribute based on your deployment stage:

  1. Development : https://wwwdev.ebi.ac.uk/docbot/api
  2. Integration : https://wwwint.ebi.ac.uk/docbot/api
  3. Production : https://www.ebi.ac.uk/docbot/api

Note

The Integration environment is only available inside the EBI VPN. So please use the dev version if you want to test it outside EBI.