Recent searches


No recent searches

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



Posted Oct 19, 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 comment

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


Sign in to leave a comment.

Didn't find what you're looking for?

New post