User Management

Managing the current user


0xPass provides a simple way to authenticate and manage any information tied to the current user.

The useUser hook provides all contextual information on the user:

User object is ONLY created for authenticated or verified users. These are users that Sign In With Ethereum. The user object is null for unauthenticated users.


Import the useUser into your component

import { useUser } from "0xpass"

Use in the code

const { user } = useUser()

You can later access user identities as follows

<p> User's Twitter Username: {user.twitter.screen_name} </p>


useUser() returns several usable properties. Below is the exhaustive list:

Example on how to capture a specific property from useUser()

const { user, getAccessToken } = useUser()
PropertyUsageDetailed Guide
userProvides contexual information about userrUser-Entity
loginFunction used to login user-
logoutFunction used to logout user-
getAccessTokenGet Access Token for user (async)Access Token
isAuthenticatedBoolean (is user authenticated?)-
isLoadingBoolean (is something in transit)-
linkGoogleLink Google accountSocial Accounts
linkFarcasterLink Farcaster accountSocial Accounts
linkTwitterLink Twitter accountSocial Accounts
unlinkGoogleUnlink Google accountSocial Accounts
unlinkFarcasterUnlink Farcaster accountSocial Accounts
unlinkTwitterUnlink Twitter accountSocial Accounts