Javascript API

Open, Close and Toggle widget

LiveCaller.$emit('ui.widget.open');
LiveCaller.$emit('ui.widget.close');
LiveCaller.$emit('ui.widget.toggle'); 

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

<script>
  document.getElementById('your button id').addEventListener('click', function (e) {
    e.preventDefault()LiveCaller.$emit('ui.widget.toggle')})
</script>

Listen to the widget opening or closing events

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

Change language

change en to your native language 2 letter iso code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

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: https://jwt.io/

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:

Edit Customer JWT Payload example:

User authorization

User profile update

User Logout

Last updated