Hooks
`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.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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>
);
}
{
isAuthenticated: boolean;
profile?: {
fid?: number;
username?: string;
bio?: string;
displayName?: string;
pfpUrl?: string;
custody?: Hex;
verifications?: Hex[];
},
};
| Parameter | Description |
|---|---|
isAuthenticated | True when the user is logged in. |
profile.fid | User’s Farcaster ID. |
profile.username | User’s username. |
profile.bio | User’s bio text. |
profile.displayName | User’s display name. |
profile.pfpUrl | User’s profile picture URL. |
profile.custody | User’s FID custody address. |
profile.verifications | List of user’s verified addresses. |
Was this page helpful?