Auxx.ai

useCurrentUser

Access the current user inside your Auxx app.

useCurrentUser returns the currently logged-in user. It's a React hook injected at runtime by the Auxx platform.

import { useCurrentUser } from '@auxx/sdk/client'
import { TextBlock, Avatar } from '@auxx/sdk/client'

function UserGreeting() {
  const user = useCurrentUser()

  return (
    <>
      <Avatar src={user.avatar} alt={user.name} />
      <TextBlock align="left">Hello, {user.name}</TextBlock>
    </>
  )
}

Signature

function useCurrentUser(): User

Return type

interface User {
  id: string
  email: string
  name: string
  avatar?: string
}
FieldTypeDescription
idstringUser identifier
emailstringUser's email address
namestringUser's display name
avatarstring?URL to the user's avatar image