specifically, why setSessionData does not set anything but rather retrieves something from Cookes. Same goes for getSessionData - it sets some data but does not return anything.
Also, I copied the example as is but I'm getting Client token is required error when I'm trying to open the web chat. What am I doing wrong? Thanks.
Some of the Genesys Widgets modules/plugins (UI), like the WebChat module, can be used with the different Genesys platforms (Genesys Cloud, Genesys Engage, PureConnect).
The protocol, used underneath, will change (defined through WebChatService) - but the WebChat UI is common to all three platforms.
setSessionData and getSessionData and the WebChatService description, on the page you referenced, are specific to the Genesys Engage platform.
Hi Jerome,
thank you for your reply.
The configuration that I'm using has webchat.transport.type set to pureengage-v3-rest.
Does this define what platform is being used?
So, I guess I'm using the wrong forum?
I have asked someone about the geSessionData/setSessionData. I am also wondering if the functions are switched or just the parameters.
I'll update this post if ever I get an answer.
Could you confirm that you are trying to connect your WebChat Widgets to a Genesys Engage Cloud environment (formerly PureEngage Cloud)?
And did you contact Customer Care so they could create an x-api-key for your environment and for nexus chat (and I assume a chat endpoint)?
If yes, would you have a test page so I can try on my side to understand what your issue may be (you can send me the url via Private Message if it is public - or the html/js source of your page otherwise)?
I don't have access to a Genesys Engage Cloud environment, but I tried to initiate a chat and didn't see this Client Token is required error. So might come from Genesys Engage Cloud side. A test page would help to understand.
From what I understand, getSessionData is to save the sessionData (the JWT Token) in cookies or in an external system (a DB or whatever you want - modifying the corresponding code).
getSessionData will be invoked after you have created a chat and when you have obtained a JWT token from Genesys Engage Cloud for that chat. You can then save this sessionData (in a cookie in the example).
setSessionData is to set the sessionData (the saved JWT Token of a previous async chat session) in the Widgets plugin (so it can "reopen" the existing async chat session).
When you open the Chat Form/when you start a chat, the setSessionData will be invoked to retrieve the saved JWT Token (from cookies, from external system) and will allow to set it in the Widgets Plugin.