i am looking like tawk.to i am using system a PHP so i need to identify my customer there name and phone number like that
Hello please send us your registered account email at hello@livecaller.io and we will give you all the necessary instructions + JWT code. We have a Javascript API for user authentication:
<script>
// open widget window
LiveCaller.$emit('ui.widget.open');
// close widget window
LiveCaller.$emit('ui.widget.close');
// toggle widget window
LiveCaller.$emit('ui.widget.toggle');
// customer authorization
LiveCaller.$emit('user.login', 'JWT Token Here');
// customer profile editing
LiveCaller.$emit('user.update', 'JWT Token Here');
// change language after widget load
LiveCaller.$emit('app.locale.update', 'ka');
// change language before widget load
LiveCaller.config.merge({app: {locale: 'ka'}});
// Customer logout / session regeneration
LiveCaller.$emit('user.logout');
// Listen to the widget window open event
LiveCaller.$on('ui.widget.open', () => {
});
// Listen to the widget window close event
LiveCaller.$on('ui.widget.close', () => {
});
</script>
for authentication and profile editing is used JWT
verification algorithm HS256
token lifetime is 15 minutes( can be changed from widget settings )
necessary payload information:
sub - unique id of the customer
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": "user@example.com",
"mobile": "995000123456",
"iat": 1565610612
}