I need help implementing HubSpot’s live chat feature in my React application built with Gatsby. Our team received instructions to place this script tag directly in the HTML body:
<script type="text/javascript" id="hubspot-chat-loader" async defer src="//js.hs-scripts.com/yournumberhere"></script>
The problem is our deployment process doesn’t include the public directory where the main HTML file lives. Since we can’t modify the index.html directly, I’m wondering if there’s a way to load this chat script dynamically through a React component instead. What would be the best approach to integrate this third-party chat widget without touching the static HTML file? I’m fairly new to handling external scripts in React so any guidance would be appreciated.