?
AppUser
TypeThe signed-in user every auth call returns; read it for identity and roles.
The shape of a signed-in user, resolved by every sign-in call and by getCurrentUser. It carries the user's id, verified email and phone (either can be null), the role ids they hold, a masked API key value, and a provider tag that reads 'remy' for a delegated user. Roles and the delegated provider are platform-managed; enforce access from them on the backend rather than trusting them from the client.
AppUser.ts
interface AppUser { id: string email: string | null phone: string | null roles: string[] apiKey: string | null provider?: 'remy' | null createdAt: string }
Fields
id
string
The user's row id in the app's user table.
email
string | null
Verified email, or null for a phone-only or delegated user.
phone
string | null
Verified phone, or null when none is set.
roles
string[]
Role ids the user holds; empty until assigned.
apiKey
string | null
ReadonlyMasked key value (sk_…xxxx), or null when none exists.
provider?
'remy' | null
'remy' for a delegated user; null or absent for app-verified.
createdAt
string
ISO timestamp of when the account was created.
Read identity and roles
const user = auth.getCurrentUser(); if (user?.roles.includes('admin')) { /* ... */ } const delegated = user?.provider === 'remy';