A handy ReactJS component to be used for loading ZenDesk Chat into your website or web app. SSR supported. If you are using your own button to start a chat, script wont run until then, which helps with speed performance, especially Lighthouse.
$ npm install @goranefbl/react-zendesk-chat
To use this module, just import the library and use like:
import ZenDeskChat from '@goranefbl/react-zendesk-chat';
<ZenDeskChat
appID="YOUR_ZENDESK_CHAT_APP_ID"
onlineMsg="Live Chat Help"
offlineMsg="Leave us a message"
buttonID="js-livechat-open"
alwaysShow
/>;
buttonID is the ID of a button that will make chat widget appear when clicked. Or pass alwaysShow prop to make chat widget always visible on page. In the first case, script wont run at all until button is clicked which helps with speed performance, so thats prefered way of using it.
Thanks @leljak for async idea.
MIT © Goran Jakovljevic