Before calling any of the methods, Glassix's script has to be loaded.
We can set a callback function which is called after the script has been loaded.

window.glassixWidgetScriptLoaded = function(){
  // now we can call the widget's methods
};

setWidgetVisiblity

Show/hide the widget programmatically.

widgetClient.setWidgetVisiblity(true);

getframeUri

Returns a promise with the uri to set as the iframe source. Use this method if you wish to add the chat in your own iframe.

widgetClient.getIframeUri().then(function (uri) {
      var iframe = document.getElementsByTagName("iframe");
      iframe.src = uri;
});

destroy

widgetClient.destroy();

attach

This method is called automatically after the script was loaded, there is no need to call it explicitly.

widgetClient.attach();