AutobotX Chat

Introduction

This guide shows you how to get started with the AutobotX Chat Web SDK. The Web SDK gives businesses and developers the flexibility to build and customize a chat experience that meets their specific design and brand requirements.

The SDK is exposed as window.abxChat. All API methods, events, and constants are accessible through this object. An internal full-form alias window.AutobotXChatWidget is also available but abxChat is the recommended way to interact with the SDK.

Concepts

The Web SDK is a JavaScript library embedded via a script tag. It automatically handles the real-time connection with the chat servers and manages the visitor session. It provides a list of events and convenient methods so you can focus on integration.

API Conventions

  • Getter methods (e.g. .getVisitorInfo()) return values synchronously.
  • Setter / action methods (e.g. .setVisitorInfo()) are asynchronous and accept an optional Node.js-style callback function(err, data) { ... }.
  • .on() and .off() (or .un() on the shorthand alias) are the main methods to register/de-register real-time events.
// Getter - synchronous
console.log(abxChat.getVisitorInfo());

// Setter - async with optional callback
abxChat.setVisitorInfo(
  { display_name: 'Jane' },
  function(err) {
    if (!err) {
      console.log('Updated:', abxChat.getVisitorInfo());
    }
  }
);

// Callback is optional - this also works:
abxChat.setVisitorInfo({ display_name: 'Jane' });

Event Registry

The SDK provides an event registry for real-time updates. Register listeners with .on() and remove them with .off(). The .on() method returns an unsubscribe function for convenience.

function listener(detail) { /* ... */ }

// Register
abxChat.on('connection_update', listener);

// De-register (option 1)
abxChat.off('connection_update', listener);

// De-register (option 2) - using .un() alias
abxChat.un('connection_update', listener);

// De-register (option 3) - using return value
var unsub = abxChat.on('chat', listener);
unsub(); // removes the listener

Error Handling

There are two types of errors:

  1. Validation errors — occur when methods are called with invalid parameters. These are logged to the console unless suppressed via suppress_console_error: true in init(). You can also capture them via the 'error' event.
  2. Execution errors — passed as the first argument to the callback function (err). If successful, err is null.
abxChat.init({
  account_key: 'YOUR_API_TOKEN',
  suppress_console_error: true
});

// Or capture errors via the event
abxChat.on('error', function(err) {
  console.error('SDK Error:', err);
});

Chat Participants

Every chat participant has a unique nick property. For visitors it is 'visitor'. For agents it follows the format 'agent:<agent-id>'.

Guide

Getting Started

Add the embed script to your page. This creates the widget iframe and exposes window.abxChat and window.abxChat.

<!-- Begin AutobotX Chat Widget -->
<script type="text/javascript">
  window.abxChat || (function(d, s, id) {
    var w = (window.abxChat = function(c) { w._.push(c); });
    w._ = [];
    w.q = function() { w._.push([].slice.call(arguments)); };
    var m = ['init','open','close','toggle','on','off','identify',
      'sendChatMsg','sendTyping','setVisitorInfo','sendOfflineMsg',
      'addTags','removeTags','endChat','sendChatRating','sendChatComment',
      'sendFile','sendEmailTranscript','sendVisitorPath','updateConfig'];
    m.forEach(function(k) { w[k] = function() {
      w._.push([k].concat([].slice.call(arguments))); }; });
    var e = d.createElement(s);
    e.async = true; e.id = id;
    e.src = "https://agent-builder.autobotx.ai/api/widget?key=YOUR_KEY";
    var t = d.getElementsByTagName(s)[0];
    t.parentNode.insertBefore(e, t);
  })(document, "script", "autobotx-chat-widget");
</script>
<!-- End AutobotX Chat Widget -->

Place this snippet before the closing </body> tag. You can safely call SDK methods immediately — they will be queued and executed once the script loads:

// These work BEFORE the script finishes loading:
abxChat.open();
abxChat.on('connection_update', function(status) {
  console.log('Connection:', status);
});

Initializing the SDK

If you need to pass additional configuration (e.g. a different API token or suppress errors), call init():

abxChat.init({
  account_key: 'YOUR_API_TOKEN',
  suppress_console_error: false
});

// Wait for connection before consuming APIs
abxChat.on('connection_update', function(status) {
  if (status === 'connected') {
    // Ready to use API methods
    console.log('Account status:', abxChat.getAccountStatus());
  }
});

Chat

A chat starts when the visitor or agent sends the first message. When this happens, a chat.memberjoin event fires. Use sendChatMsg() to send messages and endChat() to end the session.

// Send a message
abxChat.sendChatMsg('Hello!', function(err) {
  if (!err) console.log('Message sent');
});

// Listen for incoming messages
abxChat.on('chat', function(event_data) {
  if (event_data.type === 'chat.msg') {
    console.log(event_data.display_name + ': ' + event_data.msg);
  }
});

Typing

// Tell agents the visitor is typing
abxChat.sendTyping(true);

// Listen for agent typing
abxChat.on('chat', function(event_data) {
  if (event_data.type === 'typing') {
    console.log('Agent typing:', event_data.typing);
  }
});

Chat Transcript

Visitors can request the transcript to be emailed when the chat ends:

abxChat.sendEmailTranscript('visitor@example.com', function(err) {
  if (!err) console.log('Transcript scheduled');
});

Chat Feedback

// Rate the chat
abxChat.sendChatRating('good', function(err) { /* ... */ });

// Leave a comment
abxChat.sendChatComment('Very helpful!', function(err) { /* ... */ });

Attachments

// Send a file (max 20MB)
var fileInput = document.getElementById('fileInput');
abxChat.sendFile(fileInput.files[0], function(err, data) {
  if (!err) {
    console.log('File URL:', data.url);
  }
});

// Receive attachments via 'chat' event
abxChat.on('chat', function(event_data) {
  if (event_data.type === 'chat.file') {
    console.log('Attachment:', event_data.attachment.url);
  }
});

Offline Messages

abxChat.sendOfflineMsg({
  name: 'John',
  email: 'john@example.com',
  phone: '12345678',
  message: 'Please get back to me'
}, function(err) {
  if (!err) console.log('Offline message sent');
});

API Reference

The complete list of API methods available on abxChat (and abxChat).

abxChat.init(options)

Initializes the SDK with your API token and optional configuration.

ParameterTypeRequiredDescription
optionsObjectYesConfiguration object

Properties of options:

ParameterTypeRequiredDescription
account_keyStringYesYour API token (also accepts apiToken)
suppress_console_errorBooleanNoSet true to suppress validation errors in the console. Defaults to false.
abxChat.init({
  account_key: 'YOUR_API_TOKEN',
  suppress_console_error: false
});

abxChat.getAccountStatus()

Returns the current account status synchronously.

Sync Getter
ValueTypeDescription
'online'StringAccount is online
'away'StringAccount is away
'offline'StringAccount is offline
var status = abxChat.getAccountStatus();
// 'online'

abxChat.getConnectionStatus()

Returns the current connection state synchronously.

Sync Getter
ValueTypeDescription
'connected'StringConnection established
'connecting'StringConnection in progress
'closed'StringConnection closed
var conn = abxChat.getConnectionStatus();
// 'connected'

abxChat.getVisitorInfo()

Returns the current visitor's information synchronously.

Sync Getter

Returned VisitorInfo object:

ValueTypeDescription
display_nameStringDisplay name of visitor
emailStringEmail of visitor
phoneStringPhone number of visitor
var info = abxChat.getVisitorInfo();
// { display_name: 'John', email: 'john@example.com', phone: '' }

abxChat.setVisitorInfo(options, callback)

Updates the current visitor's information.

Async ActionCallback Optional
ParameterTypeRequiredDescription
optionsObjectYesVisitor info to update
callbackFunctionNoOptional Node.js-style callback (err, data)

Properties of options:

ParameterTypeRequiredDescription
display_nameStringNoDisplay name (max 255 chars)
emailStringNoMust match EMAIL_REGEX
phoneStringNoNumeric, max 25 chars
abxChat.setVisitorInfo({
  display_name: 'Jane Doe',
  email: 'jane@example.com'
}, function(err) {
  if (!err) console.log('Updated');
});

// Without callback (also valid)
abxChat.setVisitorInfo({ display_name: 'Jane' });

abxChat.sendVisitorPath(options, callback)

Sends the visitor's current page path. Useful for single-page apps to track navigation.

Async ActionCallback Optional
ParameterTypeRequiredDescription
optionsObjectYesPage information
callbackFunctionNoOptional callback

Properties of options:

ParameterTypeRequiredDescription
titleStringYesPage title
urlStringYesValid URL
abxChat.sendVisitorPath({
  title: 'Pricing',
  url: 'https://example.com/pricing'
});

abxChat.getQueuePosition()

Returns the visitor's queue position as an integer. Returns 0 if not in queue.

Sync Getter
ValueTypeDescription
queue_positionIntegerVisitor's position in the queue, or 0
var pos = abxChat.getQueuePosition();
// 3

abxChat.getAllDepartments()

Returns an array of all departments.

Sync Getter

Department object:

ValueTypeDescription
idIntegerDepartment ID
nameStringDepartment name
statusString'online', 'away', or 'offline'
var depts = abxChat.getAllDepartments();
// [{ id: 1, name: 'Sales', status: 'online' }, ...]

abxChat.getDepartment(id)

Returns a specific department by ID.

Sync Getter
ParameterTypeRequiredDescription
idIntegerYesDepartment ID
var dept = abxChat.getDepartment(1);
// { id: 1, name: 'Sales', status: 'online' }

abxChat.getVisitorDefaultDepartment()

Returns the visitor's default department, or undefined if not set.

Sync Getter

abxChat.setVisitorDefaultDepartment(id, callback)

Sets the visitor's default department.

Async ActionCallback Optional
ParameterTypeRequiredDescription
idIntegerYesDepartment ID
callbackFunctionNoOptional callback
abxChat.setVisitorDefaultDepartment(1, function(err) {
  if (!err) console.log('Default department set');
});

abxChat.clearVisitorDefaultDepartment(callback)

Clears the visitor's default department. Only works before chat starts.

Async ActionCallback Optional
ParameterTypeRequiredDescription
callbackFunctionNoOptional callback

abxChat.sendChatMsg(msg, callback)

Sends a chat message from the visitor. Should only be used when the account is online.

Async ActionCallback Optional
ParameterTypeRequiredDescription
msgStringYesMessage to send (1-2000 chars)
callbackFunctionNoOptional callback
abxChat.sendChatMsg('Hello!', function(err) {
  if (!err) console.log('Sent');
});

abxChat.sendFile(file, callback)

Sends a file attachment from the visitor. Max file size: 20MB.

Async ActionCallback Optional
ParameterTypeRequiredDescription
fileFileYesFile object to send
callbackFunctionNoCallback with (err, data). Data has: mime_type, name, size, url
abxChat.sendFile(file, function(err, data) {
  if (!err) {
    console.log('Uploaded:', data.name, data.url);
  }
});

abxChat.sendOfflineMsg(options, callback)

Sends an offline message when the account or department is offline.

Async ActionCallback Optional
ParameterTypeRequiredDescription
optionsObjectYesMessage data
callbackFunctionNoOptional callback

Properties of options:

ParameterTypeRequiredDescription
nameStringYesVisitor name (max 255 chars)
emailStringYesMust match EMAIL_REGEX
phoneStringNoPhone (numeric, max 25 chars)
messageStringYesThe offline message
abxChat.sendOfflineMsg({
  name: 'John',
  email: 'john@example.com',
  phone: '12345678',
  message: 'I need help with my order'
}, function(err) {
  if (!err) console.log('Offline message sent');
});

abxChat.addTags(tags, callback)

Adds visitor tags. Tags are automatically lowercased.

Async ActionCallback Optional
ParameterTypeRequiredDescription
tagsArray[String]YesTags to add
callbackFunctionNoOptional callback
abxChat.addTags(['vip', 'premium'], function(err) {
  if (!err) console.log('Tags added');
});

abxChat.removeTags(tags, callback)

Removes existing visitor tags.

Async ActionCallback Optional
ParameterTypeRequiredDescription
tagsArray[String]YesTags to remove
callbackFunctionNoOptional callback
abxChat.removeTags(['vip'], function(err) { /* ... */ });

abxChat.sendTyping(is_typing)

Sends the visitor's typing status to the agents.

ParameterTypeRequiredDescription
is_typingBooleanYestrue if typing, false otherwise
abxChat.sendTyping(true);  // visitor is typing
abxChat.sendTyping(false); // visitor stopped

abxChat.getChatInfo()

Returns the visitor's rating and comment for the current chat.

Sync Getter

ChatInfo object:

ValueTypeDescription
ratingString | null'good', 'bad', or null
commentString | nullVisitor comment or null
var info = abxChat.getChatInfo();
// { rating: 'good', comment: 'Very helpful' }

abxChat.sendChatRating(rating, callback)

Sends the visitor's chat rating.

Async ActionCallback Optional
ParameterTypeRequiredDescription
ratingStringYes'good', 'bad', or null to remove
callbackFunctionNoOptional callback
abxChat.sendChatRating('good', function(err) { /* ... */ });

abxChat.sendChatComment(comment, callback)

Sends the visitor's chat comment.

Async ActionCallback Optional
ParameterTypeRequiredDescription
commentStringYesComment text (max 1000 chars)
callbackFunctionNoOptional callback
abxChat.sendChatComment('Great support!', function(err) { /* ... */ });

abxChat.isChatting()

Returns whether there is an ongoing chat session.

Sync Getter
ValueTypeDescription
trueBooleanThere is an ongoing chat
falseBooleanNo active chat
if (abxChat.isChatting()) {
  console.log('Chat in progress');
}

abxChat.getChatLog()

Returns the chat log messages for the current session. This is a convenience getter for the chat event.

Sync Getter
var log = abxChat.getChatLog();
// Returns a Promise that resolves to an array of chat messages

abxChat.getServingAgentsInfo()

Returns information about agents currently serving in the chat.

Sync Getter

AgentInfo object:

ValueTypeDescription
nickStringAgent nick (e.g. 'agent:123')
display_nameStringAgent display name
avatar_pathStringURL to agent avatar
titleStringAgent title / byline
var agents = abxChat.getServingAgentsInfo();
// [{ nick: 'agent:1', display_name: 'Agent Smith', ... }]

abxChat.getOperatingHours()

Returns the account's operating hours, or undefined if not configured.

Sync Getter

OperatingHours object:

ValueTypeDescription
enabledBooleantrue if operating hours is enabled
typeString'account' or 'department'
timezoneStringTimezone string
account_scheduleScheduleAccount schedule (if type is 'account')
department_scheduleObjectDepartment schedules (if type is 'department')
var hours = abxChat.getOperatingHours();
// { enabled: true, type: 'account', timezone: 'America/New_York', ... }

abxChat.sendEmailTranscript(email, callback)

Schedules the chat transcript to be emailed when the chat ends.

Async ActionCallback Optional
ParameterTypeRequiredDescription
emailStringYesValid email address
callbackFunctionNoOptional callback
abxChat.sendEmailTranscript('john@example.com', function(err) {
  if (!err) console.log('Transcript scheduled');
});

abxChat.fetchChatHistory(callback)

Fetches past chat history. Paginated internally — successive calls fetch older items.

Async ActionCallback Optional
ParameterTypeRequiredDescription
callbackFunctionNoCallback with (err, data). Data has: count, has_more
abxChat.fetchChatHistory(function(err, data) {
  if (!err) {
    console.log('Fetched', data.count, 'items');
    console.log('Has more:', data.has_more);
  }
});

abxChat.markAsRead()

Updates the last read timestamp. Only works during an active chat.

abxChat.markAsRead();

abxChat.reconnect()

Reconnects when the connection status is 'closed'.

if (abxChat.getConnectionStatus() === 'closed') {
  abxChat.reconnect();
}

abxChat.endChat(options, callback)

Ends the current chat session.

Async ActionCallback Optional
ParameterTypeRequiredDescription
optionsObjectNoEnd chat options
callbackFunctionNoOptional callback

Properties of options:

ParameterTypeRequiredDescription
clear_dept_id_on_chat_endedBooleanNotrue to reset department on next chat. Defaults to false.
abxChat.endChat(
  { clear_dept_id_on_chat_ended: true },
  function(err) { /* ... */ }
);

abxChat.logout()

Logs out an authenticated visitor. Closes the connection. Re-initialize with init() to reconnect.

abxChat.logout();

Constants

abxChat.EMAIL_REGEX / abxChat.EMAIL_REGEX

The email validation regex used by the SDK.

var regex = abxChat.EMAIL_REGEX;
// /^[^\s@]+@[^\s@]+\.[A-Z|a-z]{2,}\b/

Internal rate-limiting constants:

ConstantValue
MAX_CHAT_MESSAGE_LENGTH2000
MIN_CHAT_MESSAGE_LENGTH1
MAX_CHAT_COMMENT_LENGTH1000
MAX_DISPLAY_NAME_LENGTH255
MAX_PHONE_LENGTH25
MAX_TAGS_PER_SESSION50
MAX_TAG_LENGTH50
MAX_OFFLINE_MESSAGE_LENGTH2000
MAX_OFFLINE_MESSAGES_PER_MINUTE5
MAX_CHAT_MESSAGES_PER_MINUTE10
MAX_FILE_SEND_OPERATIONS_PER_MINUTE10
FILE_SEND_TIMEOUT30000 ms
CHAT_HISTORY_ITEMS_PER_PAGE20

Events

Real-time events are emitted and can be listened to via .on(event_name, handler) and removed via .off(event_name, handler).

'account_status' event

Fired when the account's online/offline status changes.

ValueTypeDescription
'online'StringAccount is online
'away'StringAccount is away
'offline'StringAccount is offline
abxChat.on('account_status', function(status) {
  console.log('Account is now:', status);
});

'connection_update' event

Fired when the WebSocket connection state changes.

ValueTypeDescription
'connecting'StringConnection is being established
'connected'StringConnection established, data is current
'closed'StringConnection closed
abxChat.on('connection_update', function(status) {
  if (status === 'connected') {
    // Safe to use API methods
  }
});

'department_update' event

Fired when any department's status changes.

Department object:

ValueTypeDescription
idIntegerDepartment ID
nameStringDepartment name
statusString'online', 'away', or 'offline'
abxChat.on('department_update', function(dept) {
  console.log(dept.name, 'is', dept.status);
});

'visitor_update' event

Fired when the visitor's information changes.

abxChat.on('visitor_update', function(visitorInfo) {
  console.log('Visitor:', visitorInfo.display_name);
});

'agent_update' event

Fired when an agent's information changes (e.g., agent joins chat).

AgentInfo object:

ValueTypeDescription
nickStringAgent nick
display_nameStringAgent name
avatar_pathStringAvatar URL
titleStringAgent title
abxChat.on('agent_update', function(agentInfo) {
  console.log('Agent joined:', agentInfo.display_name);
});

'chat' Event

The chat event encompasses all real-time chat activity. The event_data.type property indicates the specific type:

TypeDescription
chat.msgA chat message arrives
chat.fileA file attachment arrives
chat.queue_positionVisitor's queue position changed
chat.memberjoinVisitor or agent joins the chat
chat.memberleaveVisitor or agent leaves the chat
chat.request.ratingAgent requests a rating
chat.ratingVisitor updates chat rating
chat.commentVisitor updates chat comment
typingAgent starts or stops typing
last_readLast read timestamp updated

chat.msg

Fired when a chat message arrives.

ValueTypeDescription
typeStringAlways 'chat.msg'
nickStringSender nick
display_nameStringSender display name
timestampIntegerServer timestamp in ms
msgStringMessage content
abxChat.on('chat', function(e) {
  if (e.type === 'chat.msg') {
    console.log(e.display_name + ': ' + e.msg);
  }
});

chat.file

Fired when a file attachment is received.

ValueTypeDescription
typeStringAlways 'chat.file'
nickStringSender nick
display_nameStringSender display name
timestampIntegerServer timestamp in ms
attachmentAttachmentFile attachment object

Attachment object:

ValueTypeDescription
mime_typeStringMIME type (e.g. 'image/png')
nameStringFile name
sizeIntegerFile size in bytes
urlStringURL to the file
abxChat.on('chat', function(e) {
  if (e.type === 'chat.file') {
    console.log('File:', e.attachment.name, e.attachment.url);
  }
});

chat.queue_position

Fired when the visitor's position in the wait queue changes.

ValueTypeDescription
typeStringAlways 'chat.queue_position'
nickStringAlways 'system:queue'
queue_positionIntegerPosition in queue, or 0 if not queued
abxChat.on('chat', function(e) {
  if (e.type === 'chat.queue_position') {
    console.log('Queue position:', e.queue_position);
  }
});

chat.memberjoin

Fired when a visitor or agent joins the chat.

ValueTypeDescription
typeStringAlways 'chat.memberjoin'
nickStringParticipant nick
display_nameStringParticipant display name
timestampIntegerServer timestamp in ms
abxChat.on('chat', function(e) {
  if (e.type === 'chat.memberjoin') {
    console.log(e.display_name + ' joined');
  }
});

chat.memberleave

Fired when a visitor or agent leaves the chat.

ValueTypeDescription
typeStringAlways 'chat.memberleave'
nickStringParticipant nick
display_nameStringParticipant display name
timestampIntegerServer timestamp in ms
abxChat.on('chat', function(e) {
  if (e.type === 'chat.memberleave') {
    console.log(e.display_name + ' left');
  }
});

chat.request.rating

Fired when an agent requests a rating from the visitor.

ValueTypeDescription
typeStringAlways 'chat.request.rating'
nickStringAgent nick
display_nameStringAgent display name
timestampIntegerServer timestamp in ms

chat.rating

Fired when the visitor updates the chat rating.

ValueTypeDescription
typeStringAlways 'chat.rating'
nickStringAlways 'visitor'
new_ratingString | undefinedNew rating ('good' or 'bad')
ratingString | undefinedPrevious rating

chat.comment

Fired when the visitor updates the chat comment.

ValueTypeDescription
typeStringAlways 'chat.comment'
nickStringAlways 'visitor'
new_commentString | undefinedNew comment
commentString | undefinedPrevious comment

typing

Fired when an agent starts or stops typing.

ValueTypeDescription
typeStringAlways 'typing'
nickStringAgent nick
typingBooleantrue if agent is typing
abxChat.on('chat', function(e) {
  if (e.type === 'typing') {
    console.log(e.nick, 'typing:', e.typing);
  }
});

last_read

Fired when the last read timestamp is updated.

ValueTypeDescription
typeStringAlways 'last_read'
nickStringParticipant nick
timestampIntegerServer timestamp in ms

'history' event

Emitted when chat history items are fetched via fetchChatHistory(). Follows the same type structure as 'chat' events.

abxChat.on('history', function(event_data) {
  if (event_data.type === 'chat.msg') {
    console.log('History message:', event_data.msg);
  }
});

'error' event

Fired when a validation error occurs.

ValueTypeDescription
messageStringError message
contextStringMethod that triggered the error
extraAnyAdditional error info
abxChat.on('error', function(err) {
  console.error('SDK error in', err.context, ':', err.message);
});

Pre-load Queue & Aliases

Pre-load Command Queue

The embed snippet creates abxChat as a lightweight stub with method queuing. You can call SDK methods before the script finishes loading — they are queued and automatically replayed once the SDK is ready. Both styles work:

// Style 1: Direct method calls (queued automatically)
abxChat.open();
abxChat.on('connection_update', function(status) {
  console.log(status);
});
abxChat.sendChatMsg('Hello!');

// Style 2: Callback wrapper (also queued)
abxChat(function() {
  // Runs once SDK is fully loaded
  console.log('Status:', abxChat.getAccountStatus());
});

.un() Alias

abxChat.un(event, handler) is a convenience alias for .off(event, handler). Both do the same thing:

// These are equivalent:
abxChat.off('chat', handler);
abxChat.un('chat', handler);

Alternate Global Name

The SDK is also accessible via window.AutobotXChatWidget (internal full-form name). Both globals point to the same API. Use abxChat in your integration code.

Extended API

These are additional methods beyond the core chat SDK surface.

Widget Control

MethodReturnsDescription
open()voidOpens the chat widget
close()voidCloses the chat widget
toggle()voidToggles widget open/closed
isOpen()Promise<boolean>Returns whether the widget is open
identify(userData)voidSends user identification to the widget
updateConfig(config)voidUpdates widget configuration
// Open the widget
abxChat.open();

// Identify a user
abxChat.identify({
  name: 'John Doe',
  email: 'john@example.com',
  id: '12345'
});

Tags (Extended)

MethodDescription
getTags(callback)Gets current visitor tags
clearTags(callback)Clears all visitor tags

Tracking & Privacy

MethodDescription
enableURLTracking()Enables URL change tracking
disableURLTracking()Disables URL change tracking
enableReferrerTracking()Enables referrer tracking
disableReferrerTracking()Disables referrer tracking
enableVisitorTracking()Enables visitor activity tracking
disableVisitorTracking()Disables visitor activity tracking
setConsent({ analytics, functional })Sets GDPR consent preferences
getConsent()Gets current consent state
deleteUserData()Deletes all stored user data
exportUserData()Exports all stored user data
getReferrerData()Returns referrer tracking data
getTrafficSource()Returns traffic source classification
getCampaignData()Returns UTM / campaign data

Capabilities

MethodReturnsDescription
getCapabilities()ObjectDetected browser capabilities
getCapabilityTier()Number1=CORE, 2=ENHANCED, 3=ADVANCED
isFeatureSupported(feature)BooleanChecks if a feature is supported
getStorageType()String'localStorage' or 'memoryCache'
enableFingerprinting()voidEnables device fingerprinting
disableFingerprinting()voidDisables device fingerprinting
generateFingerprint()Object|nullGenerates device fingerprint
getFingerprint()Object|nullReturns current fingerprint
getFingerprintSignature()String|nullReturns fingerprint signature
getFingerprintConfidence()NumberReturns fingerprint confidence (0-1)
AutobotX Chat Web SDK Documentation