To get the current user, inspect the
If a user has not linked an account of a given type, the corresponding field on the Below is an example of how you might use the Refreshing the
In order to update a
user object returned by the usePrivy hook:const { user } = usePrivy();
Unauthenticated users
For unauthenticated users, theuser object will be null.Authenticated users
For authenticated users, you can use the following fields:Hide User
Hide User
string
required
The Privy-issued DID for the user. If you need to store additional information about a user, you
can use this DID to reference them.
string
required
The datetime of when the user was created, in ISO 8601 format.
array
required
The list of accounts associated with this user. Each account contains additional metadata that may
be helpful for advanced use cases.
Show Properties
Show Properties
Show Wallet
Show Wallet
'wallet'
required
Denotes that this is a wallet account
string | null
required
The wallet ID of the wallet. Null if the wallet is not delegated. Only applies to embedded
wallets (walletClientType === ‘privy’)
string
required
The wallet address
'ethereum' | 'solana'
required
Chain type of the wallet address
string
required
The wallet client used for this wallet during the most recent verification. If the value is
‘privy’, then this is a privy embedded wallet
string
required
The connector type used for this wallet during the most recent verification
'privy' | UserRecoveryMethod
required
If this is a ‘privy’ embedded wallet, stores the recovery method
boolean
required
Whether the wallet is imported. Only applies to embedded wallets (walletClientType === ‘privy’)
boolean
required
Whether the wallet is delegated. Only applies to embedded wallets (walletClientType === ‘privy’)
number | null
required
HD index for the wallet. Only applies to embedded wallets (walletClientType === ‘privy’)
Show SmartWallet
Show SmartWallet
Show Google
Show Google
Show Twitter
Show Twitter
'twitter_oauth'
required
Denotes that this is a Twitter account
string
required
The ‘sub’ claim from the Twitter-issued JWT for this account
string | null
required
The username associated with the Twitter account
string | null
required
The name associated with the Twitter account
string | null
required
The profile picture URL associated with the Twitter account
Show Discord
Show Discord
Show Github
Show Github
'github_oauth'
required
Denotes that this is a Github account
string
required
The ‘sub’ claim from the Github-issued JWT for this account
string | null
required
The username associated with the Github account
string | null
required
The name associated with the Github account
string | null
required
The email associated with the Github account
Show Spotify
Show Spotify
Show Instagram
Show Instagram
Show Tiktok
Show Tiktok
Show Line
Show Line
'line_oauth'
required
Denotes that this is a Line account
string
required
The ‘sub’ claim from the Line-issued JWT for this account
string | null
required
The name associated with the Line account
string | null
required
The email associated with the Line account
string | null
required
The profile image URL associated with the Line account
Show LinkedIn
Show LinkedIn
'linkedin_oauth'
required
Denotes that this is a LinkedIn account
string
required
The ‘sub’ claim from the LinkedIn-issued JWT for this account
string | null
required
The name associated with the LinkedIn account
string | null
required
The email associated with the LinkedIn account
string | null
required
The vanityName/profile URL associated with the LinkedIn account
Show Apple
Show Apple
Show CustomJwt
Show CustomJwt
Show Farcaster
Show Farcaster
'farcaster'
required
Denotes that this is a Farcaster account
number | null
required
The Farcaster on-chain FID
string
required
The Farcaster ethereum address that owns the FID
string | null
required
The Farcaster protocol username
string | null
required
The Farcaster protocol display name
string | null
required
The Farcaster protocol bio
string | null
required
The Farcaster protocol profile picture
string | null
required
The Farcaster protocol profile url
string | null
required
The public key of the signer, if set. This is not guaranteed to be valid, as the user can revoke
the key at any time
Show Passkey
Show Passkey
'passkey'
required
Denotes that this is a Passkey account
string
required
The passkey credential ID
boolean
required
Whether or not this passkey can be used for MFA
string
required
The type of authenticator holding the passkey
string
required
Metadata about the device that registered the passkey
string
required
Metadata about the OS that registered the passkey
string
required
Metadata about the browser that registered the passkey
Show Telegram
Show Telegram
'telegram'
required
Denotes that this is a Telegram account
string
required
The user ID that owns this Telegram account
string | null
required
The first name of the user
string | null
required
The last name of the user
string | null
required
The username associated with the Telegram account
string | null
required
The url of the user’s profile picture
Show CrossApp
Show CrossApp
'cross_app'
required
Denotes that this is a cross-app account
{ address: string }[]
required
The user’s embedded wallet address(es) from the provider app
{ address: string }[]
required
The user’s smart wallet address(es) from the provider app
ProviderAppMetadata
required
Metadata about the provider app
string
required
The subject identifier for this cross-app account
array
required
The list of MFA Methods associated with this user.
boolean
required
Whether or not the user has explicitly accepted the Terms and Conditions and/or Privacy Policy
boolean
required
Whether or not the user is a guest
Show Optional fields
Show Optional fields
object
The user’s email address, if they have linked one. It cannot be linked to another user.
Show Properties
Show Properties
string
The email address.
object
The user’s phone number, if they have linked one. It cannot be linked to another user.
Show Properties
Show Properties
string
The phone number.
object
The user’s first verified wallet, if they have linked at least one wallet. It cannot be linked to
another user.
object
object
object
The user’s Twitter account, if they have linked one. It cannot be linked to another user.
object
object
The user’s Github account, if they have linked one. It cannot be linked to another user.
object
object
object
object
The user’s Line account, if they have linked one. It cannot be linked to another user.
object
The user’s LinkedIn account, if they have linked one. It cannot be linked to another user.
object
object
The user’s Farcaster account, if they have linked one. It cannot be linked to another user.
Show Properties
Show Properties
number
The Farcaster on-chain FID
string
The Farcaster ethereum address that owns the FID
string
The Farcaster protocol username
string
The Farcaster protocol display name
string
The Farcaster protocol bio
string
The Farcaster protocol profile picture
string
The Farcaster protocol profile url
string
The public key of the signer, if set. This is not guaranteed to be valid, as the user can
revoke the key at any time
object
The user’s Telegram account, if they have linked one. It cannot be linked to another user.
object
Custom metadata field for a given user account
You can set custom metadata for a user via Privy’s backend server SDK and/or
API endpoints.
user object will be undefined.Users can have multiple passkeys linked to their account. To find all linked
passkeys, use the
linkedAccounts list and filter by passkey account type.user object in a minimal user profile:Example User Profile
import { usePrivy } from "@privy-io/react-auth";
function User() {
const { ready, authenticated, user } = usePrivy();
// Show nothing if user is not authenticated or data is still loading
if (!(ready && authenticated) || !user) {
return null;
}
return (
<div>
<p>User {user.id} has linked the following accounts:</p>
<ul>
<li>Apple: {user.apple ? user.apple.email : "None"}</li>
<li>Discord: {user.discord ? user.discord.username : "None"}</li>
<li>Email: {user.email ? user.email.address : "None"}</li>
<li>Farcaster: {user.farcaster ? user.farcaster.username : "None"}</li>
<li>GitHub: {user.github ? user.github.username : "None"}</li>
<li>Google: {user.google ? user.google.email : "None"}</li>
<li>Instagram: {user.instagram ? user.instagram.username : "None"}</li>
<li>LinkedIn: {user.linkedin ? user.linkedin.email : "None"}</li>
<li>Line: {user.line ? user.line.email : "None"}</li>
<li>Phone: {user.phone ? user.phone.number : "None"}</li>
<li>Spotify: {user.spotify ? user.spotify.email : "None"}</li>
<li>Telegram: {user.telegram ? user.telegram.username : "None"}</li>
<li>TikTok: {user.tiktok ? user.tiktok.username : "None"}</li>
<li>Twitter: {user.twitter ? user.twitter.username : "None"}</li>
<li>Wallet: {user.wallet ? user.wallet.address : "None"}</li>
</ul>
</div>
);
}
Refreshing the user object
In order to update a user object after any type of backend update, (i.e. unlinking an account or setting custom metadata) you can ensure the user object in the application is up-to-date by invoking the refreshUser method from the useUser hook:Example refresh User
import { useUser } from "@privy-io/react-auth";
const { user, refreshUser } = useUser();
const updateMetadata = async (value: string) => {
// Make API request to update custom metadata for a user from the backend
const response = await updateUserMetadata({ value });
await refreshUser();
// `user` object should be updated
console.log(user);
};

