Skip to main content

A8Chat Web Widget

Chat Bot Script

Embed the below script into your website to acquire the chat widget. 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

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


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


✅ This to decide what we want on chat initiate. It has the following options.


✅ Chat icon will be loaded without notification.


✅ Chat widget will be open directly.


✅ If notify has given, chat icon will be loaded with 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 was opened.


✅ This is to decide that how long the chat conversation should be there in the widget. Default session duration is 15 minutes. We can change the session duration as per client requirement. This is the 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 User ID of the particular client's users, we can use either ( erId) or (localStorage.userId). If the same chat opened in multiple tabs of a single browser, localStorage.userId local will create same chat session in all the tabs and sessionStorage.userId will create unique chat session of the particular chat in each tab of same browser.

This is possible only in case when that user Id provided by us.