getAuthDetails
getAuthDetails
returns the details about the authenticated user, in accordance with the Turnkey
SDK's specifications.
This method must be called after authenticate
. Otherwise, this method will throw an error with the message Not Authenticated
.
Usage
example.ts
import { createTurnkeySigner } from "./turnkey";
const turnkeySigner = await createTurnkeySigner();
const details = await turnkeySigner.getAuthDetails();
Returns
Promise<TurnkeyUserMetadata>
A Promise
containing the TurnkeyUserMetadata
, and object with the following fields:
organizationId: string
-- unique identifier for the user's organization.organizationName: string
-- human-readable name for the user's organization.userId: string
-- unique identifier for the user.username: string
-- human-readable name for the user.