From a10dcaae4adcdb5d1aa537d7e1729bf0ec26206e Mon Sep 17 00:00:00 2001 From: Marc Knaup Date: Wed, 12 Jun 2024 02:34:25 +0700 Subject: [PATCH 1/4] Added `crossOrigin` config option --- README.md | 1 + apps/playground/cypress/e2e/crossOrigin.ts | 12 +++++ apps/playground/src/app.tsx | 8 ++++ .../src/modules/useIntercom/index.ts | 1 + .../useIntercomWithCrossOrigin.tsx | 44 +++++++++++++++++++ packages/react-use-intercom/src/initialize.ts | 8 +++- packages/react-use-intercom/src/provider.tsx | 3 +- packages/react-use-intercom/src/types.ts | 4 ++ 8 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 apps/playground/cypress/e2e/crossOrigin.ts create mode 100644 apps/playground/src/modules/useIntercom/useIntercomWithCrossOrigin.tsx diff --git a/README.md b/README.md index 65616e20..d2405cda 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ Place the `IntercomProvider` as high as possible in your application. This will | apiBase | string | If you need to route your Messenger requests through a different endpoint than the default. Generally speaking, this is not needed.
Format: `https://${INTERCOM_APP_ID}.intercom-messenger.com` (See: [https://github.com/devrnt/react-use-intercom/pull/96](https://github.com/devrnt/react-use-intercom/pull/96)) | false | | | initializeDelay | number | Indicates if the intercom initialization should be delayed, delay is in ms, defaults to 0. See https://github.com/devrnt/react-use-intercom/pull/236 | false | | | autoBootProps | IntercomProps | Pass properties to `boot` method when `autoBoot` is `true` | false | | +| crossOrigin | string | `crossOrigin` attribute value to pass to `