Skip to content

useProfile

Hook for reading information about the authenticated user.

You can use this hook to read the authenticated user's profile information from other components inside your app.

tsx
import { useProfile } from '@farcaster/auth-kit';

function App {
  const {
    isAuthenticated,
    profile: { username, fid, bio, displayName, pfpUrl },
  } = useProfile();

  return (
    <div>
      {isAuthenticated ? (
        <p>
          Hello, {username}! Your fid is: {fid}
        </p>
      ) : (
        <p>You're not signed in.</p>
      )}
    </div>
  );
};

Returns

ts
  {
    isAuthenticated: boolean;
    profile?: {
        fid?: number;
        username?: string;
        bio?: string;
        displayName?: string;
        pfpUrl?: string;
        custody?: Hex;
        verifications?: Hex[];
    },
  };
ParameterDescription
isAuthenticatedTrue when the user is logged in.
profile.fidUser's Farcaster ID.
profile.usernameUser's username.
profile.bioUser's bio text.
profile.displayNameUser's display name.
profile.pfpUrlUser's profile picture URL.
profile.custodyUser's FID custody address.
profile.verificationsList of user's verified addresses.