From 04267773f748a6e7c0b6f6ec862a62ac2158c159 Mon Sep 17 00:00:00 2001 From: Matt Gabrenya Date: Thu, 19 Oct 2023 16:50:04 -0700 Subject: [PATCH] feat: specify parent html element to insert COMB iframe into --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ef9e0c1..e128b76 100644 --- a/src/index.ts +++ b/src/index.ts @@ -108,7 +108,7 @@ class WebSdkApi implements AppAgentClient { let child try { - child = await ((window).COMB || (global).COMB).connect(url.href, 60000) + child = await ((window).COMB || (global).COMB).connect(url.href, authOpts.container || document.body, 60000) } catch (err) { if (err.name === 'TimeoutError') console.log('Chaperone did not load properly. Is it running?') @@ -289,6 +289,8 @@ type AuthFormCustomization = { // An arbitrary value that will be passed to the Membrane Proof Server as additional information payload: unknown }, + // The parent HTMLElement to insert the login iframe into. Defaults to `document.body` + container?: HTMLElement, // INTERNAL OPTION // anonymous_allowed is barely implemented in Chaperone, and is subject to change, // so exposing this in the documentation is misleading.