Class: TurnkeyIframeClient
Defined in: sdk-browser/src/__clients__/browser-clients.ts:862 TurnkeyIframeClient is a client that uses an iframe to interact with the Turnkey API. It is used to create read-write sessions, and to inject credential bundles into the iframe. It is also used to extract encrypted credential bundles from the iframe.Extends
Constructors
Constructor
new TurnkeyIframeClient(Defined in: sdk-browser/src/__clients__/browser-clients.ts:865config):TurnkeyIframeClient
Parameters
config
TurnkeySDKClientConfig
Returns
TurnkeyIframeClient
Overrides
TurnkeyBrowserClient.constructor
Properties
authClient?
Defined in: sdk-browser/src/__clients__/base-client.ts:5optionalauthClient:AuthClient
Inherited from
TurnkeyBrowserClient.authClient
iframePublicKey
iframePublicKey:Defined in: sdk-browser/src/__clients__/browser-clients.ts:863null|string
Methods
addUserAuth()
addUserAuth(Defined in: sdk-browser/src/__clients__/browser-clients.ts:541 Adds or updates authentication factors for an end user. This function allows selectively adding:params):Promise<any[]>
- Phone number
- Authenticators
- OAuth providers
- API keys
Parameters
params
AddUserAuthParams
A structured object containing all the addition/update parameters
Returns
Promise<any[]>
A promise that resolves to an array of results from each addition or update
Inherited from
TurnkeyBrowserClient.addUserAuth
clearEmbeddedKey()
clearEmbeddedKey():Defined in: sdk-browser/src/__clients__/browser-clients.ts:924Promise<null>
Returns
Promise<null>
deleteUserAuth()
deleteUserAuth(Defined in: sdk-browser/src/__clients__/browser-clients.ts:477 Removes authentication factors from an end user. This function allows selectively removing:params):Promise<any[]>
- Phone number
- Authenticators (by ID)
- OAuth providers (by ID)
- API keys (by ID)
Parameters
params
DeleteUserAuthParams
A structured object containing all the removal parameters
Returns
Promise<any[]>
A promise that resolves to an array of results from each removal operation
Inherited from
TurnkeyBrowserClient.deleteUserAuth
extractKeyEncryptedBundle()
extractKeyEncryptedBundle():Defined in: sdk-browser/src/__clients__/browser-clients.ts:916Promise<string>
Returns
Promise<string>
extractWalletEncryptedBundle()
extractWalletEncryptedBundle():Defined in: sdk-browser/src/__clients__/browser-clients.ts:912Promise<string>
Returns
Promise<string>
getEmbeddedPublicKey()
getEmbeddedPublicKey():Defined in: sdk-browser/src/__clients__/browser-clients.ts:920Promise<null|string>
Returns
Promise<null | string>
initEmbeddedKey()
initEmbeddedKey():Defined in: sdk-browser/src/__clients__/browser-clients.ts:928Promise<null|string>
Returns
Promise<null | string>
injectCredentialBundle()
injectCredentialBundle(Defined in: sdk-browser/src/__clients__/browser-clients.ts:870credentialBundle):Promise<boolean>
Parameters
credentialBundle
string
Returns
Promise<boolean>
injectImportBundle()
injectImportBundle(Defined in: sdk-browser/src/__clients__/browser-clients.ts:900bundle,organizationId,userId):Promise<boolean>
Parameters
bundle
string
organizationId
string
userId
string
Returns
Promise<boolean>
injectKeyExportBundle()
injectKeyExportBundle(Defined in: sdk-browser/src/__clients__/browser-clients.ts:888credentialBundle,organizationId,keyFormat?):Promise<boolean>
Parameters
credentialBundle
string
organizationId
string
keyFormat?
KeyFormat
Returns
Promise<boolean>
injectWalletExportBundle()
injectWalletExportBundle(Defined in: sdk-browser/src/__clients__/browser-clients.ts:878credentialBundle,organizationId):Promise<boolean>
Parameters
credentialBundle
string
organizationId
string
Returns
Promise<boolean>
login()
login(Defined in: sdk-browser/src/__clients__/browser-clients.ts:110config?):Promise<object&object>
Parameters
config?
organizationId?
string
Returns
Promise<object & object>
Inherited from
TurnkeyBrowserClient.login
loginWithAuthBundle()
loginWithAuthBundle(Defined in: sdk-browser/src/__clients__/browser-clients.ts:433 Logs in with an existing auth bundle. this bundle enables both read and write requests.credentialBundle,expirationSeconds):Promise<boolean>
Parameters
credentialBundle
string
expirationSeconds
string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
Returns
Promise<boolean>
Inherited from
TurnkeyBrowserClient.loginWithAuthBundle
loginWithBundle()
loginWithBundle(Defined in: sdk-browser/src/__clients__/browser-clients.ts:206 Log in with a bundle. This method uses a bundle sent to the end user email To be used in conjunction with anparams):Promise<void>
iframeStamper.
Parameters
params
LoginWithBundleParams
Returns
Promise<void>
Inherited from
TurnkeyBrowserClient.loginWithBundle
loginWithPasskey()
loginWithPasskey(Defined in: sdk-browser/src/__clients__/browser-clients.ts:262 Log in with a passkey. To be used in conjunction with aparams):Promise<void>
passkeyStamper
Parameters
params
LoginWithPasskeyParams
Returns
Promise<void>
Inherited from
TurnkeyBrowserClient.loginWithPasskey
loginWithReadWriteSession()
loginWithReadWriteSession(Defined in: sdk-browser/src/__clients__/browser-clients.ts:396 Creates a read-write session. This method infers the current user’s organization ID and target userId. To be used in conjunction with antargetEmbeddedKey,expirationSeconds,userId?):Promise<object&object>
iframeStamper: the resulting session’s credential bundle can be
injected into an iframeStamper to create a session that enables both read and write requests.
Parameters
targetEmbeddedKey
string
expirationSeconds
string = DEFAULT_SESSION_EXPIRATION_IN_SECONDS
userId?
string
Returns
Promise<object & object>
Inherited from
TurnkeyBrowserClient.loginWithReadWriteSession
loginWithSession()
loginWithSession(Defined in: sdk-browser/src/__clients__/browser-clients.ts:239 Log in with a session object. This method uses a session object from server actions and stores it and the active client in local storage To be used in conjunction with ansession):Promise<void>
iframeStamper.
Parameters
session
Session
Returns
Promise<void>
Inherited from
TurnkeyBrowserClient.loginWithSession
loginWithWallet()
loginWithWallet(Defined in: sdk-browser/src/__clients__/browser-clients.ts:329 Log in with a browser wallet.params):Promise<void>
Parameters
params
LoginWithWalletParams
Returns
Promise<void>
Inherited from
TurnkeyBrowserClient.loginWithWallet
refreshSession()
refreshSession(Defined in: sdk-browser/src/__clients__/browser-clients.ts:138 Attempts to refresh an existing Session. This method infers the current user’s organization ID and target userId. This will use a passkeyStamper forparams):Promise<void>
READ_ONLY sessions or an iframeStamper for READ_WRITE sessions.
Parameters
params
RefreshSessionParams
Returns
Promise<void>
Inherited from
TurnkeyBrowserClient.refreshSession
updateUserAuth()
updateUserAuth(Defined in: sdk-browser/src/__clients__/browser-clients.ts:605 Comprehensive authentication update for an end user. Combines add/update and delete operations into a single call. The behavior is driven by whether values are set to:params):Promise<boolean>
- A string/array (to create or update)
nullor an array of IDs (to remove)
Parameters
params
UpdateUserAuthParams
A structured object containing all the update parameters
Returns
Promise<boolean>
A promise that resolves to a boolean indicating overall success
Inherited from
TurnkeyBrowserClient.updateUserAuth