Get user info
Use the useWeb3AuthUser hook to read the signed-in user's profile. The hook loads userInfo
when the user connects and clears it when the user disconnects.
Usage
import { useWeb3AuthUser } from '@web3auth/react-native-sdk'
import { Image, Text, View } from 'react-native'
function UserProfile() {
const { userInfo, isMFAEnabled } = 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>Signed in with: {userInfo.authConnection}</Text>
<Text>MFA enabled: {isMFAEnabled ? 'Yes' : 'No'}</Text>
</View>
)
}
See useWeb3AuthUser for all userInfo fields.