Javascript Reference v1.0

Retrieve a user

Gets the current user details.

  • Fetches the user object from the database instead of local storage.
  • Note that user() fetches the user object from local storage which might not be the most updated.
  • Requires the user's access_token.
Parameters
    jwt
    REQUIRED
    string

    A valid, logged-in JWT. Typically, the access_token for the currentSession


const { user, error } = await supabase.auth.api.getUser(
  'ACCESS_TOKEN_JWT',
)