BlueForge Docs

client.auth.getUser

Get the currently authenticated user.

Signature

class Client {
  auth: {
    getUser(): Promise<AuthUser | null>
  }
}

Examples

const user = await bf.auth.getUser()
if (user) {
  console.log(`Hello ${user.name ?? user.email}`)
}

Throws

ErrorCondition
ApiError
API request failed
NetworkError
Network issue

Pitfalls

  • Requires auth — returns null if no user is signed in or the session is expired

See also

{auto-injected}

Tested against

{auto-injected}