getIdentityToken
Function to retrieve the identity token from Web3Auth.
note
This function will only return information based on the connected adapter. These details are not stored anywhere and are fetched from the adapter during the connection and remain in the session.
Usage
// Later in your code:
try {
const idToken = await web3auth.getIdentityToken();
console.log(idToken);
} catch (error) {
console.error("Error authenticating user:", error);
}
Return Type
getIdentityToken(): Promise<UserAuthInfo>
type UserAuthInfo = { idToken: string };