Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
Zendesk authentication

I need to display user's name in the in the zendesk chat ( for the agents), I'm using the code provided by zendesk:

window.zESettings = {
 webWidget: {
   authenticate: {
     chat: {
       jwtFn: function(callback) { 
         fetch('JWT_TOKEN_ENDPOINT').then(function(res) {
            res.text().then(function(jwt) {
             callback(jwt);
            });
          });
        }
      } 
    }
  }
};

and jwt token is:

var payload = {
  name: '#{customerName}',
  email: '#{customerEmail}',
  iat: #{timestamp},
  external_id: '#{externalId}'
};
var token = jwt.sign(payload, '#{yourSecret}');

The code doesn't work, I don't get errors but user name is not visible. Zendesk documentation doesn't provide any valuable information, has anyone integrated Zendesk in their app? What am I doing wrong? any help and suggestion is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I'm running into some issues with a similar implementation. In my situation I am using the same Javascript to authenticate the chat webWidget. I have my JWT_TOKEN_ENDPOINT defined in a rails controller (RoR) which uses the ruby-jwt gem to generate the token.

In my case though, my browser is showing the error message:

Zendesk Chat Web SDK: Error: init: Failed to verify token: jwt verification error

Are you seeing any browser console errors to suggest what might be the issue?

Do you have your endpoint setup to generate the JWT token?

Are you passing a valid shared secret in the jwt.sign(payload, "#{youSecret}") var assignment?

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda