diff --git a/.changeset/wise-donkeys-prove.md b/.changeset/wise-donkeys-prove.md new file mode 100644 index 000000000..1b6bbe2dd --- /dev/null +++ b/.changeset/wise-donkeys-prove.md @@ -0,0 +1,6 @@ +--- +"@turnkey/sdk-browser": patch +"@turnkey/sdk-react": patch +--- + +Update TurnkeySDKBrowserConfig type with an optional iframeUrl field. The TurnkeyContext provider will check for an iframeUrl otherwise it will fallback to the default. diff --git a/packages/sdk-browser/src/__types__/base.ts b/packages/sdk-browser/src/__types__/base.ts index 54f33ae39..e7ee2db74 100644 --- a/packages/sdk-browser/src/__types__/base.ts +++ b/packages/sdk-browser/src/__types__/base.ts @@ -91,6 +91,7 @@ export interface TurnkeySDKBrowserConfig { defaultOrganizationId: string; rpId?: string; serverSignUrl?: string; + iframeUrl?: string; } export type queryOverrideParams = { diff --git a/packages/sdk-react/src/contexts/TurnkeyContext.tsx b/packages/sdk-react/src/contexts/TurnkeyContext.tsx index e185a7d85..15565fc41 100644 --- a/packages/sdk-react/src/contexts/TurnkeyContext.tsx +++ b/packages/sdk-react/src/contexts/TurnkeyContext.tsx @@ -123,7 +123,7 @@ export const TurnkeyProvider: React.FC = ({ iframeContainer: document.getElementById( TurnkeyAuthIframeContainerId ), - iframeUrl: "https://auth.turnkey.com", + iframeUrl: config.iframeUrl || "https://auth.turnkey.com", iframeElementId: TurnkeyAuthIframeElementId, }); setAuthIframeClient(newAuthIframeClient);