V2 Configuration

There are multiple configuration options that can control how our version 2 messenger behaves.

ServisBOT Messenger Configuration Options

container: This enables you to take over an entire div with the messenger. Just supply the id of the div you want filled.

   container: ‘#container’

url: This is the URL that you registered with ServisBOT. eg. eg. If you registered your company name as ‘Hooli’, your url would look like the following - ‘https://hooli.servisbot.com'. This option is required.

organization: the organizational code this bot is related to, i.e. flowit

shortBotId: the 9 character reference for a bot, i.e. 0dloyEMnyA

dir: This option determines the direction of text in the messenger. The options are ltr and rtl. The default option is ltr.

displayLightbox: Determines whether the messenger displays as a rondel and in a lightbox mode when enabled.

displayWidget: This option determines whether or not the ServisBOT widget is displayed. The ServisBOT widget is displayed on the bottom right hand corner of your web page, and toggles the view of the ServisBOT web messenger. This field is optional.

displayHeader: This option determines whether or not the header is displayed. This field is optional. If not specified by the user it will be displayed by default.

displayRoundel: This option determines whether or not the roundel is displayed. This field is optional. If not specified by the user it will be displayed by default.

alwaysOpen: This field specifies whether the ServisBOT web messenger is permanently displayed or not. This field is optional.

context: extra information to send into the bot. * userToken: value used to verify user is within a secureSession.

expiredEvent: This field specifies a callback to alert parent app with secureSession failures. googleApiKey: This field is for the Google API key to be used to display maps in the messenger

Updating the context

A rewriteContext method is available if you wish to replace the content that was passed to the embeddable messenger at init time:

ServisBot.rewriteContext({
  organization: '{yourOrganization}',
  shortBotId: '{yourBotId-within-Organization}',
  displayWidget: true,
  alwaysOpen: false,
  context : {
    firstName: 'Michael',
    lastName: 'Schumacher',
  },
});

Populating Messenger with a message

With version 2 of our messenger. It is possible to populate message queries into your messenger. First, make sure you have installed our messenger as described, then call the function below.

window.lightningLauncher.setMessage("Hello");

You can also then send that message on behalf of the users at anytime

window.lightningLauncher.submitMessage();

Sending a message through messenger

With version 2 of our messenger. It is possible to send messages on behalf of the user with one function. First, make sure you have installed our messenger as described, then call the function below.

window.lightningLauncher.sendMessage("Hello New");