zendeskApi('messenger', 'open'), zendeskApi('webWidget', 'open') and zendeskApi('webWidget', 'hide') not working | Community
Skip to main content

zendeskApi('messenger', 'open'), zendeskApi('webWidget', 'open') and zendeskApi('webWidget', 'hide') not working

  • March 30, 2023
  • 3 replies
  • 0 views

Alistair11

Hi Zendesk Team and Community, 

I am trying to use these zendeskApi('messenger', 'open'),

zendeskApi('webWidget', 'open') and zendeskApi('webWidget', 'hide') but it is totally unresponsive in React. 

Please advise and thanks!

 

 

3 replies

Greg29
  • March 30, 2023

Hi Alistair! Could you provide some more details here? Are you trying to make a React wrapper for the widget or are you adding the widget to a React page? Are you seeing any console errors? Any additional details that you can provide will be helpful.


Alistair11
  • Author
  • March 31, 2023

Hi Greg, trying to add it as a pop up. So when I click on a button, I want the widget to appear. When clicked on, it either says Zendesk component has not been initialised or after initialising, no error is found.


Greg29
  • March 31, 2023

To clarify, you mention that after it's initialized, no error is found, but there are initialization errors. So it sounds like you're running this function before the widget has initialized on the page. I would recommend taking a look at these docs to get an idea of how to get it setup, even though that isn't in React, the rest is generally the same.