Skip to content

Commit

Permalink
Merge pull request #110 from mattyg/feat/specify-parent-htmlelement
Browse files Browse the repository at this point in the history
feat: specify parent html element to insert COMB iframe into
  • Loading branch information
robbiecarlton committed Oct 21, 2023
2 parents 09d06ea + 0426777 commit 0c1fe87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class WebSdkApi implements AppAgentClient {

let child
try {
child = await ((<any>window).COMB || (<any>global).COMB).connect(url.href, 60000)
child = await ((<any>window).COMB || (<any>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?')
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0c1fe87

Please sign in to comment.