Skip to main content

user()

Return user data if there is a logged in user

const { user, error } = await kontenbase.auth.user()

Response

NameTypeDescription
res.userobjectResponse for data user
res.statusnumberResponse for status code
res.statusTextstringResponse for status message
res.errorobjectResponse for error occurred
note
  • When using SDK you need to call register() or login() first
  • When using API you need to set the Bearer token returned by register or login API in the header request
  • Get user with filter:
    • lookup
const { user, error } = await kontenbase.auth.user({
lookup: ['categories'],
})