For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

getUserInfo

Function to retrieve information about the connected user.

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.

info

For external wallet logins, this function returns no user details, only an empty linkedAccounts array ({ linkedAccounts: [] }). It only returns user details for social login embedded wallets.

Usage​

// After successful login
const userInfo = await web3auth.getUserInfo()
console.log(userInfo)

Return type​

PropertyTypeDescription
emailstringEmail of the user.
namestringName of the user.
profileImagestringProfile image of the user.
groupedAuthConnectionIdstringGrouped auth connection ID used for sign-in, if any.
authConnectionIdstringAuth connection ID used for sign-in.
userIdstringUnique user ID from the auth provider.
authConnectionstringAuth connection type used for sign-in (for example, google).
dappSharestringDapp share of the user.
idTokenstringToken issued by Web3Auth.
oAuthIdTokenstringToken issued by OAuth provider. Will be available only if you are using custom connections.
oAuthAccessTokenstringAccess token issued by OAuth provider. Will be available only if you are using custom connections.
appStatestringApp state of the user.
touchIDPreferencestringTouch ID preference of the user.
isMfaEnabledbooleanWhether Multi Factor Authentication is enabled for the user.
linkedAccountsarrayAccounts linked to the user, each a LinkedAccountInfo object.

Sample response​

{
"email": "john@gmail.com",
"name": "John Dash",
"profileImage": "https://lh3.googleusercontent.com/a/Ajjjsdsmdjmnm...",
"authConnectionId": "<your auth connection ID>",
"userId": "john@gmail.com",
"authConnection": "google",
"dappShare": "<24 words seed phrase>", // will be sent only incase of custom connections
"idToken": "<jwtToken issued by Web3Auth>",
"oAuthIdToken": "<jwtToken issued by OAuth Provider>", // will be sent only incase of custom connections
"oAuthAccessToken": "<accessToken issued by OAuth Provider>", // will be sent only incase of custom connections
"linkedAccounts": []
}