Class: Turnkey
Defined in: sdk-browser/src/sdk-client.ts:64Constructors
Constructor
new Turnkey(Defined in: sdk-browser/src/sdk-client.ts:69config):TurnkeyBrowserSDK
Parameters
config
TurnkeySDKBrowserConfig
Returns
TurnkeyBrowserSDK
Properties
config
config: TurnkeySDKBrowserConfig
Defined in: sdk-browser/src/sdk-client.ts:65
stamper
Defined in: sdk-browser/src/sdk-client.ts:67protectedstamper:undefined|Stamper
Methods
currentUserSession()
currentUserSession():Defined in: sdk-browser/src/sdk-client.ts:190 If there is a valid, current user session, this will return a read-enabled TurnkeyBrowserClient that can make read requests to Turnkey without additional authentication. This is powered by a session header resulting from a prior successfulPromise<undefined|TurnkeyBrowserClient>
login call.
Returns
Promise<undefined | TurnkeyBrowserClient>
getCurrentSubOrganization()
getCurrentSubOrganization():Defined in: sdk-browser/src/sdk-client.ts:256 Fetches the current user’s organization details.Promise<undefined|SubOrganization>
Returns
Promise<undefined | SubOrganization>
getCurrentUser()
getCurrentUser():Defined in: sdk-browser/src/sdk-client.ts:268 Fetches the currently active user.Promise<undefined|User>
Returns
Promise<undefined | User>
getReadWriteSession()
getReadWriteSession():Defined in: sdk-browser/src/sdk-client.ts:216 If there is a valid, current read-session, this will return an auth bundle and its expiration. This auth bundle can be used in conjunction with an iframeStamper to create a read + write session.Promise<undefined|ReadWriteSession>
Returns
Promise<undefined | ReadWriteSession>
Deprecated
usegetSession instead
getSession()
getSession():Defined in: sdk-browser/src/sdk-client.ts:236 If there is a valid, active READ_WRITE session, this will return itPromise<undefined|Session>
Returns
Promise<undefined | Session>
iframeClient()
iframeClient(Defined in: sdk-browser/src/sdk-client.ts:106params):Promise<TurnkeyIframeClient>
Parameters
params
IframeClientParams
Returns
Promise<TurnkeyIframeClient>
logout()
logout():Defined in: sdk-browser/src/sdk-client.ts:306 Clears out all data pertaining to an end user session.Promise<boolean>
Returns
Promise<boolean>
passkeyClient()
passkeyClient(Defined in: sdk-browser/src/sdk-client.ts:78 Creates a passkey client. The parameters override the default values passed to the underlying Turnkeyparams?):TurnkeyPasskeyClient
WebauthnStamper
Parameters
params?
PasskeyClientParams
Returns
TurnkeyPasskeyClient
new TurnkeyPasskeyClient
serverSign()
serverSign<Defined in: sdk-browser/src/sdk-client.ts:144TResponseType>(methodName,params,serverSignUrl?):Promise<TResponseType>
Type Parameters
TResponseType
TResponseType
Parameters
methodName
string
params
any[]
serverSignUrl?
string
Returns
Promise<TResponseType>
walletClient()
walletClient(Defined in: sdk-browser/src/sdk-client.ts:135wallet):TurnkeyWalletClient
Parameters
wallet
WalletInterface
Returns
TurnkeyWalletClient