I am trying to integrate the FC widget into a React web application. Does anyone have experience doing this and can point me towards some good resources.
I have it almost working, but I am having problem clearing a user on logout, then setting a different user on login, without closing the browser window first.
It appears that the widget does not like being initiated with one user and their restoreId then switching to a different user. Any advice on dealing with this scenario?
I wanted to express my gratitude for your assistance. Your guidance helped me in implementing the chat widget on my React web application with the restore ID concept. However, I’ve encountered some challenges regarding restoring chats or displaying previous conversations once a chat is resolved. After each chat resolution, whether by bot or agent, the system prompts for CSAT and then initiates a completely new chat session. Our aim is to provide users with access to their previous chat history upon login.
Additionally, there are a few differences in our implementations:
All users are pre-created in our database, and we retrieve the restore ID from the backend upon user login. Consequently, we only display the widget after users log in.
We utilize a custom button to toggle the widget open and closed.
Your continued support in resolving these issues would be greatly appreciated. Thanks
Oh cool, thanks, @Jinus_MK . I am happy to assist you.
I need a couple of information needed to solve your issues.
Firstly, will the widget be displayed both after login and before login?
In these cases, the above mentioned react zip code will help to solve the issues
No need to show login page only show the widget after login, means there are few code changes in the above script.
As you mentioned, upon clicking the toggle the button only you will show the widget rite, In the case when you logout the page will u destroy the widget or hide the widget?
Also, when the user logs out I’m calling the window.fcWidget.user.clear(); function and then it will automatically destory the widget as you’ve already added a listener in the provided snippet and it works as expected.
The only issue I’m facing right now is , I’m unable to restore the chat after resolving even though the chats are restored as expected till the conversation getting resolved but this is against our expectation since we would like to show the chat history always
Please let me know if you need any more information
There is an option called Hide Resolve Conversation in admin settings, if you enable that option, it will remove the chat history once you resolve the conversations.
Hey @Mani_Tamilarasan ,
We have observed that the in-app freshchat notifications when new messages are received, disrupting the overall user experience of our application.
The users can easily identify if there are any unread messages from Freshchat through the unread message count indicator. Therefore, we would like to explore the possibility of disabling the in-app notifications.
Thank you for your attention to this request. I look forward to your response and assistance.
Also, I would like to bring your attention to one more issue I’m facing while integrating freshchat with our React web application.
we encountered the following error on our console upon initializing the widget successfully.
TypeError: Cannot read properties of undefined (reading 'alias') at n.trigger (fd-messaging.ccd65bd…4158ef4.js:1:192947)
Could you please provide assistance in troubleshooting this error and guiding us on the correct steps to resolve it? Any insights or recommendations you could offer would be greatly appreciated.