Skip to main content

Install the widget

The MimicBot widget is a single <script> tag. The cold launcher is about 30 KB gzipped; React and the chat UI lazy-load only after the bubble is clicked.

Before you start

  • A bot created in your agency account (see Create your first bot).
  • The bot's publicId — a string shaped like bot_<10 chars>.
  • Write access to your site's HTML <head> (or the top of <body>).

Steps

  1. Copy the snippet below and replace bot_YOUR_PUBLIC_ID with your own publicId:

    <script
    type="module"
    crossorigin="anonymous"
    src="https://api.mimicbot.app/v3/widget.js"
    data-bot-id="bot_YOUR_PUBLIC_ID"
    ></script>
  2. Paste it into your site's HTML, ideally at the end of <body> so it doesn't block first paint.

  3. Deploy your site.

  4. Visit any page on your site and confirm a small chat bubble appears in the corner.

Optional — override the API host

If you self-host the MimicBot API at a custom domain, add data-api-base:

<script
type="module"
crossorigin="anonymous"
src="https://api.your-domain.com/v3/widget.js"
data-bot-id="bot_YOUR_PUBLIC_ID"
data-api-base="https://api.your-domain.com"
></script>

The default data-api-base is the script's origin.

What you just did

  • Added the MimicBot cold launcher to your site.
  • Configured it to talk to a specific bot via data-bot-id.
  • Isolated it from your site's CSS and JS via the shadow DOM.

Next

→ Create your first bot