From 12d5aaaa920c6a78e7ffcc955b70ca2c3e8b89ac Mon Sep 17 00:00:00 2001 From: Brian Cleary Date: Tue, 17 Dec 2024 15:32:32 -0500 Subject: [PATCH] add optional iframeUrl param --- .changeset/wise-donkeys-prove.md | 6 ++++++ packages/sdk-browser/src/__types__/base.ts | 1 + packages/sdk-react/src/contexts/TurnkeyContext.tsx | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/wise-donkeys-prove.md 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);