How to Authenticate a web widget on Runtime using a React method? | Community
Skip to main content

How to Authenticate a web widget on Runtime using a React method?

  • March 18, 2021
  • 0 replies
  • 0 views

I'm using the Zendesk Web Widget on my custom support portal. We have a user login option, so once the user logs in, the Web widget has to be authenticated to show protected content. I'm following the Authentication method mentioned in the Web Widget Classic APIs ( Ref ).

I understand this code sits in my index.html file, and is re-called everytime the page loads. However, I want to call this object through a method once my login becomes successful. Is there any way we can call this inside a React JS method to make the fetch JWT token again after the user has logged in? 

I've tried adding it to a React method but it just does not get executed. 

Other References : 

1. Article on integrating chat widget