Recent searches
No recent searches
Zendesk verification
Answered
Posted Jan 09, 2023
I need to display the user's name in the Zendesk chat (for the agents), and I'm using the Zendesk code:
window.zESettings = {
webWidget: {
authenticate: {
chat: {
jwtFn: function(callback) {
fetch('JWT_TOKEN_ENDPOINT').then(function(res) {
res.text().then(function(jwt) {
callback(jwt);
});
});
}
}
}
}
};
and the jwt token is as follows:
var payload = {
name: '#{customerName}',
email: '#{customerEmail}',
iat: #{timestamp},
external_id: '#{externalId}'
};
var token = jwt.sign(payload, '#{yourSecret}');
The code does not function, and there are no problems, but the user name is not shown. The Zendesk manual is devoid of useful information; has anyone incorporated Zendesk into their app? What am I doing incorrectly? Any assistance and suggestions are much welcomed.
0
1
1 comment
Dane
Here are the references for Classic Chat authentication and Messaging Authentication.
On my end, I have used this code for the authentication.
Server-side code
Client-side code:
0