Skip to main content

useWeb3AuthUser

Hook to access the authenticated user's profile information. The returned 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>
<Text>Name: {userInfo.name}</Text>
<Text>Email: {userInfo.email}</Text>
{userInfo.profileImage && (
<Image source={{ uri: userInfo.profileImage }} style={{ width: 48, height: 48 }} />
)}
</View>
)
}

Return type

userInfo

UserInfo | null

The authenticated user's profile object. null when no user is connected.

FieldTypeDescription
emailstringUser's email address, if provided by the authentication provider.
namestringUser's display name.
profileImagestringURL of the user's profile picture.
aggregateVerifierstringAggregate verifier identifier (grouped connection flows).
verifierstringVerifier identifier used for this authentication.
verifierIdstringThe claim value used as the user's identifier within the verifier.
typeOfLoginstringAuthentication method that was used (for example, google, jwt).
dappSharestringDevice share for MFA-enabled wallets.
oAuthIdTokenstringRaw OAuth id_token from the authentication provider.
oAuthAccessTokenstringRaw OAuth access_token from the authentication provider.
isMfaEnabledbooleanWhether MFA is currently enabled for this user.