react-use-intercom icon indicating copy to clipboard operation
react-use-intercom copied to clipboard

Added `crossOrigin`, `onLoad`, and `onLoadFailed` config options

Open fluidsonic opened this issue 1 year ago • 1 comments

  • crossOrigin: "anonymous" forces CORS when loading the Messenger script (<script crossOrigin="anonymous" …>). That in turn allows the website/app to receive full error information if the Messenger script throws an error. That's important for error logging and follow-ups with Intercom's own support.
  • onLoad and onLoadFailed are called when the Messenger script is loaded successfully or not loaded successfully. That allows for
    • showing a pending/loading animation while the chat is loading
    • showing alternative means of communication in case the Messenger can't be loaded (network issues, Intercom downtime, firewall, browser extensions that block Intercom, etc.)
  • README and Cypress tests are updated accordingly
<IntercomProvider
    …
    crossOrigin="anonymous"
    onLoad={() => console.log("Loaded!")}
    onLoadFailed={() => console.log("Failed to load!")}
>

fluidsonic avatar Jun 11 '24 22:06 fluidsonic

🦋 Changeset detected

Latest commit: e7954c5f5d6c35e724bffe5c168b1057da7a2c60

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-use-intercom Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jun 11 '24 22:06 changeset-bot[bot]