Javascript API

Open, Close and Toggle widget


example of a button, when clicked it will toggle Livecaller's widget frame

  document.getElementById('your button id').addEventListener('click', function (e) {

Listen to the widget opening or closing events

LiveCaller.$on('', () => {});
LiveCaller.$on('ui.widget.close', () => {});

Change language

change en to your native language 2 letter iso code:

Change language before the widget load

LiveCaller.config.merge({app: {locale: 'en'}});

Update language inside the loaded widget

LiveCaller.$emit('app.locale.update', 'en');

JWT authentication

For authentication and profile editing is used JWT verification algorithm HS256.

Read more about JWT here:

Token lifetime is 15 minutes Necessary payload information: sub - unique id of the customer in your system iat - token generation timestamp ( UNIX timestamp seconds)

JWT Header example:

  "alg": "HS256",
  "typ": "JWT"

Edit Customer JWT Payload example:

  "sub": "12ba81b2-c1fe-479b-8b4a-09fecb02a3d6",
  "name": "John Doe",
  "email": "",
  "mobile": "995000123456",
  "iat": 1565610612

User authorization

LiveCaller.$emit('user.login', 'JWT Token Here');

User profile update

 LiveCaller.$emit('user.update', 'JWT Token Here');

User Logout


Last updated