Aide function controls the widget. Calls made before the script has loaded are queued and run when it’s ready.
Opening and closing
To open the chat from your own button, call
Aide('open') from it. Use Aide('handoff') for your own “Contact us” buttons: the AI doesn’t answer first.
Visitors and session data
Aide('identify', user)tells Aide who the visitor is (see Identify logged-in customers securely).Aide('setSessionData', attributes)attaches extra facts to the visit, such as cart value. Proactive messages can target them.Aide('logout')forgets the visitor when they sign out of your site.Aide('reset')clears the widget’s state.
Configuration at runtime
Aide('config', options) changes options such as color, position, theme, launcherLabel or hideLauncher from code, and Aide('setLocale', 'fr') switches the widget’s language.
Events
Listen withAide('on', name, handler), stop with Aide('off', name, handler), or listen once with Aide('once', name, handler). The events are:
For example, listen for
message:received to update your own page when a new chat message comes in, or for unread:changed to show an unread badge.
Aide('ready') and Aide('info') return promises, for example to wait until the widget has loaded.
Single-page apps
SendAide('event', { type: 'page-viewed', url: location.href }) when your router changes page, so proactive messages see the right URL.