Skip to main content

Chat Bot Script

Embed the below script into your website to get the chat widget. Also, include the chat bot script dependency jquery library in your site head tag.

<script src=""> </script>

Widget Script

if (!sessionStorage.userId) {
sessionStorage.userId = new Date().getTime();

window.a8bot = {
appConfig: {
isFloatingIcon: true,
showAfterInterval: "icon",
/*"icon" || "chat" || "notify"*/
notifyText: "",
initTime: 1000,
sessionDuration: "1 day"
/*"1 year" || "2 months" || "4 days" || "6 hours" || "8 minutes"*/
cusInfo: {
appKey: "<AppKey>",
displayName: "<UserName>",
orgId: "<OrgID>",
botHandle: "<BotHandle>",
userId: "<UserID>",
email: "<EmailID>"

var script = document.createElement("script");
script.type = "text/javascript"; = "a8_chat_widget";
script.src = "<HostedURL>";


In the above script, replace the following fields wherever necessary.

  • AppKey
  • UserName
  • OrgID
  • BotHandle
  • UserID
  • EmailID
  • HostedURL


This to decide whether the chat icon should be dragable or not. If it is true you can drag, if it is false then you can't drag.


This to decide what we want on chat initiation.


Chat icon will be loaded without notification.


Chat widget will be opened directly.


If notify is given, chat icon will be loaded with the notification. We can add a text in notifyText. That text will be displayed in the notification bubble.


The duration to load chat icon after the site has been opened.


This is to decide the duration of a chat conversation in the widget. Default session duration is 15 minutes. We can change the session duration as per client's requirement.

Format of session duration: "1 year" or "2 months" or "4 days" or "6 hours" or "8 minutes"


Corresponding bot's app key.


The user name to be displayed in the chat.


Corresponding bot's organisation id.


Corresponding bot's bot handle name.


For the User ID of a particular client's users, we can use either sessionStorage.userId or localStorage.userId. If a same chat is opened in multiple tabs of a single browser, then localStorage.userId local will create a same chat session in all the tabs and sessionStorage.userId will create an unique chat session of that particular chat in each tab of the same browser.

This is possible only in cases where that user Ids are provided by us.


Email ID of the particular client's users.


Chat hosted url for loading the chat widget.


Logger feature is implemented in chat widget. Logger levels are error | debug | verbose. Default logger level is error.

If you want to change the logger level on run time. Open the browser console and set localStorage.loggerLevel = debug. Refresh the browser tab and the logs will appear on the console.

Log Levels

error is high level logs.

debug is mid level logs.

verbose is low level logs.