Skip to main content

Installation Guide

Follow these steps to install Puzzle Bot Front on your website.

Step 1: Obtain the Script

Add the following <script> tag to the <head> or the end of the <body> section of your HTML page:

<script
id="ai-bot-script"
type="module"
data-primary="primary-color"
data-secondary="secondary-color"
data-bg-chat="chat-background-color"
data-bg-response="msg-response-background-color"
data-page-size="sm"
data-title="your-title"
data-external-user-id="your-external-user-id"
data-lang="en"
data-apikey="your-api-key"
data-channel-key="your-channel-key"
data-user-session-id="your-user-session-id"
crossorigin
src="https://your-server-url.com/bot-ai"
></script>

Replace the attributes as necessary:

  • src: The URL of your bot script hosted on your server.
  • data-apikey: Your unique API key for authenticating requests to the bot service.
  • Other data-* attributes are optional for customization.

Step 2: Configure Attributes

Customize the attributes according to your needs:

Authentication

Ensure you replace your-api-key with your actual API key.

Theming

Use data-primary, data-secondary, data-bg-chat and data-bg-response to adjust the appearance.

Sizing

Adjust the size with data-page-size (possible values: sm, md, lg).

Language

Set the language with data-lang (e.g., en, es, fr).

Logging

Enable or disable logging with data-enable-logging.

Attribute Reference

AttributeDescriptionPossible ValuesDefault Value
data-primarySets the primary color of the bot interface.Any valid CSS color code#F0F2F5
data-secondarySets the secondary color used in the bot interface elements.Any valid CSS color code#54656F
data-bg-chatDefines the background color of the chat window.Any valid CSS color code#FFFFFF
data-bg-responseSets the background color for the AI responses in the chat.Any valid CSS color code#E8FFD9
data-page-sizeDetermines the size of the bot widget on the page.sm, md, lgsm
data-langSpecifies the language for the bot interface.ISO language codes (e.g., en, es)en
data-apikeyYour unique API key to authenticate requests to the bot service.StringRequired
data-titleSets the title displayed on the bot interface.StringYour Title
data-external-user-idAssociates the bot session with an external user ID.StringOptional
data-channel-keyYour channel key for integrating with specific platforms.StringRequired
data-user-session-idAssociates the bot session with a user session ID.StringOptional

Step 3: Verify the Installation

Save the changes and reload your website to verify that the assistant is displayed correctly.

Important Note

Compatibility: Some hosting providers may not allow embedded scripts. Verify with your hosting provider if there are any restrictions.