Web Widget Integration on SPA (Single Page Application)
답변함Zendesk web widget is a wonderful tool to help improve the customer service experience of my business. Thanks for the effort of Zendesk team!
However, I found that the support for SPA of the web widget is still lagging behind, giving me hard time to integrate the widget to my SPA website.
The most critical part is the Chat Authentication API. Currently, the authentication of visitors is only performed when the web widget is first loaded with the `webWidget.chat.authenticate` config set up. Access token renewal is based on script reload upon page refresh. Yet, page refresh is not a privilege for SPA. This makes it impossible for me to authenticate the site visitors with the widget, not to mention renewing the session.
Does Zendesk team have any solution for this? Or is Zendesk team planning for any support for SPA?
I believe it will be truly helpful if Zendesk team could provide an interface for us to log visitors in on the fly (say `zE('webWidget', 'login')` so that we could simply provide the method of getting access token upon widget load-up.
Thanks!
-
Hi Derek,
Thanks for sharing your feedback. Have you tried using the updatepath API already?
https://developer.zendesk.com/embeddables/docs/widget/chat#updatepath
This is used in SPA to send visitor movements to the widget/agent and that should re-trigger the authentication. If that isn't the case for you, please email chat@zendesk.com with the page URLs that you are authenticated with sample credentials and we can investigate it further for you.
-Ramin
-
Thanks Ramin for the reply! I have tried your advice but it is not working.
When I trigger:
zE('webWidget', 'updatePath')
I didn't see it calling my JWT endpoint. Seems this command will not retrigger the authentication?
-
Hi Ramin,
Even we are looking for a hook which can trigger a callback for route changes in SPA. I tried the above trigger but unfortunately it did not work for me as well
-
Please create a ticket by emailing chat@zendesk.com and we can troubleshoot your issue further from there. Thanks
댓글을 남기려면 로그인하세요.
4 댓글