How do I access Web Widget API commands in my React App?



Publicado 19 oct 2022

Stupid question - I know. But how do I access commands like zE('messenger', 'open'); straight from my react app?

All of those commands are perfectly accessible via console in dev tools. But when I try to access them in my React app functions. It doesn't work.

I basically need this to work:

<button onClick={() => zE('messenger', 'open')}>Open chat window</button>
 
But it keeps saying i dont have zE defined. Yet it works in the console.. Ahh 
 
Thanks!

0

1

1 comentario

      Hey Jiří Štěpánek,

      Can you try calling the zE method against the window object and see if that works for you? i.e:

      <button onClick={() => window.zE('messenger', 'open')}>Open chat window</button>

      0


      Iniciar sesión para dejar un comentario.

      ¿No encontró lo que buscaba?

      Nueva publicación