Visitor JS SDK

The complete API reference and code samples of the Visitor JS SDK.

The Visitor JS SDK, and the Visitor App built on top of it, enable visitors on business's website to chat, CoBrowse, talk (with audio/video), and share screen with the business.

Making the Visitor App work on the business's website is as simple as embedding the script in the <head> section of the page as follows:

<script async src="//"></script>

The Visitor JS SDK comes into the play if it is desired to tailor the behavior for specific visitors, trigger actions in other apps, etc.

A sample use case is to programmatically set the visitor's custom attributes. For example, the business knows that this is a very important visitor or a visitor who has a specific problem on the website. It can then set the custom attributes accordingly and take these attributes into account on the Glia side - e.g. for routing the visitor to the right queue or notifying an operator to proactively engage with the visitor.

The following code snippet illustrates how to obtain reference to the entry point of the Visitor JS SDK and set custom attributes of a visitor. In this illustration, the visitor is looking something related to the home insurance product:

sm.getApi({version: 'v1'}).then(function(glia) {
customAttributes: {
product: 'home-insurance'
}).then(function() {
}).catch(function(error) {
if (error.cause == glia.ERRORS.NETWORK_TIMEOUT) {
} else {

The Visitor JS SDK is very powerful and enables to do much more, for the complete list of functions see the API reference.