diff --git a/.changeset/fast-peaches-return.md b/.changeset/fast-peaches-return.md new file mode 100644 index 00000000..847cb9ae --- /dev/null +++ b/.changeset/fast-peaches-return.md @@ -0,0 +1,5 @@ +--- +'@flatfile/react': patch +--- + +Fix for addign and changing listeners when not inline diff --git a/packages/react/src/hooks/legacy/useCreateListener.ts b/packages/react/src/hooks/legacy/useCreateListener.ts index 8235aea2..b626d3be 100644 --- a/packages/react/src/hooks/legacy/useCreateListener.ts +++ b/packages/react/src/hooks/legacy/useCreateListener.ts @@ -25,6 +25,9 @@ export const useCreateListener = ({ // set the api key to fully authenticate into Flatfile api // todo: should we use CrossEnvConfig here? ;(window as any).CROSSENV_FLATFILE_API_KEY = accessToken + if (apiUrl) { + ;(window as any).CROSSENV_FLATFILE_API_URL = apiUrl + } useEffect(() => { if (listener && accessToken)