Skip to main content

Get user info

Use the useWeb3AuthUser hook to access the authenticated user's profile. The userInfo object is reactive — it updates automatically when the session changes.

Import

import { useWeb3AuthUser } from '@web3auth/react-native-sdk'

Usage

import { useWeb3AuthUser } from '@web3auth/react-native-sdk'

function UserProfile() {
const { userInfo } = useWeb3AuthUser()

if (!userInfo) return null

return (
<View>
{userInfo.profileImage && (
<Image
source={{ uri: userInfo.profileImage }}
style={{ width: 64, height: 64, borderRadius: 32 }}
/>
)}
<Text>Name: {userInfo.name}</Text>
<Text>Email: {userInfo.email}</Text>
<Text>Login method: {userInfo.typeOfLogin}</Text>
<Text>MFA enabled: {userInfo.isMfaEnabled ? 'Yes' : 'No'}</Text>
</View>
)
}

Return value fields

FieldTypeDescription
namestringUser's display name from the identity provider.
emailstringUser's email address (if provided by the identity provider).
profileImagestringURL of the user's profile image.
verifierstringThe verifier (connection) used for authentication.
verifierIdstringThe value of the claim used as the user identifier.
aggregateVerifierstringThe grouped connection ID if a grouped connection was used.
typeOfLoginstringAuthentication method (for example, google, jwt).
dappSharestringDevice share for MFA-enabled wallets. Store this in secure storage for future logins.
oAuthIdTokenstringRaw id_token from the OAuth provider.
oAuthAccessTokenstringRaw access_token from the OAuth provider.
isMfaEnabledbooleanWhether MFA is currently enabled for this account.