Skip to content

Handling the user object

All of Privy's login methods result in a unified JSON representation of your user.

To get the current user, inspect the user object returned by the usePrivy hook:

const {user} = usePrivy();

Unauthenticated users

For unauthenticated users, the user object will be null.

Authenticated users

For authenticated users, you can use the fields:

  • to get their Privy DID, which you may use to identify your user on your backend
  • user.createdAt to get a JavaScript Date object of when the user was created

The user object also contains information about all of the accounts a user has linked with Privy. Use the fields:

  • to get the user's email account
  • to get the user's phone (SMS) number
  • user.wallet to get the user's Ethereum wallet (crypto account)
  • to get the user's Google account
  • to get the user's Apple account
  • user.twitter to get the user's Twitter account
  • user.discord to get the user's Discord account
  • user.github to get the user's GitHub account
  • user.linkedin to get the user's LinkedIn account
  • user.tiktok to get the user's TikTok account
  • user.farcaster to get the user's Farcaster account
  • user.spotify to get the user's Spotify account
  • user.instagram to get the user's Instagram account

If a user has not linked an account of a given type, the corresponding field on the user object will be undefined.

Different account types contain different information about the underlying account. For example, you might use user.wallet.address to get a user's Ethereum address and user.discord.username to get a user's Discord username. Check out the SDK Reference to see what data each type contains.

Alternatively, you can also get a list of all the accounts a user has linked with Privy via user.linkedAccounts. Each account in this list is additionally annotated with a type field that denotes the type of account ('email', 'phone', 'wallet', etc.).


Users can have multiple passkeys linked to their account. To find all linked passkeys, use the linkedAccounts list and filter by passkey account type.

Below is an example of how you might use the user object in a minimal 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 (
      <p>User {} has linked the following accounts:</p>
        <li>Apple: { ? : 'None'}</li>
        <li>Discord: {user.discord ? user.discord.username : 'None'}</li>
        <li>Email: { ? : 'None'}</li>
        <li>Farcaster: {user.farcaster ? user.farcaster.username : 'None'}</li>
        <li>GitHub: {user.github ? user.github.username : 'None'}</li>
        <li>Google: { ? : 'None'}</li>
        <li>Instagram: {user.instagram ? user.instagram.username : 'None'}</li>
        <li>LinkedIn: {user.linkedin ? : 'None'}</li>
        <li>Phone: { ? : 'None'}</li>
        <li>Spotify: {user.spotify ? : 'None'}</li>
        <li>TikTok: {user.tiktok ? : 'None'}</li>
        <li>Twitter: {user.twitter ? user.twitter.username : 'None'}</li>
        <li>Wallet: {user.wallet ? user.wallet.address : 'None'}</li>