ArtiBot.ai features a number of ways for advanced users to customize their ArtiBot's behavior with the following JavaScript API.
All interaction with the ArtiBot Javascript API is handled through an API object that is written to the window when your ArtiBot snippet has loaded. This object will persist on your page, unless it is manually deleted.
window.artibotApi.on('bot:ready', function () { console.log('bot ready'); });
window.artibotApi.on('bot:expanded', function () { console.log('bot expanded'); });
window.artibotApi.on('bot:collapsed', function () { console.log('bot collapsed'); });
window.artibotApi.on('chat:started', function () { console.log('chat started'); });
window.artibotApi.on('chat:message-sent', function () { console.log('message sent'); });
window.artibotApi.on('chat:message-received', function () { console.log('message received'); });
window.artibotApi.on('chat:ended', function () { console.log('chat ended'); });
window.artibotApi.trigger('bot:expand');
window.artibotApi.trigger('bot:collapse');
window.artibotApi.trigger('bot:show');
window.artibotApi.trigger('bot:hide');
window.artibotApi.get('bot.botId');
window.artibotApi.get('bot.bubbleMessage');
window.artibotApi.get('bot.visible');
window.artibotApi.set('bot.bubbleMessage', 'My new message');
<button class="artibot-button-expand">Chat Now!</button>