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
| Error | Condition |
|---|---|
| API request failed |
| 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}