Skip to content

hailer.user

Read users. Results are scoped by app kind.

MethodHost opReturns
current()user.currentPromise<User>
get(userId)user.getPromise<User | null>
list()user.listPromise<User[]>

current()

The signed-in user.

ts
const me = await hailer.user.current();

get(userId)

ts
const user = await hailer.user.get(userId);

Returns null when the user isn't found. In a workspace app, it also returns null if the user isn't a member of the app's workspace. In a private app, any user the app can see is returned.

list()

Members of the current workspace, sorted by name (firstname lastname).

ts
const members = await hailer.user.list();

The User shape

Only _id, firstname, and lastname are populated on returned users. Other fields present on the internal user model are not sent to apps. See User.

Hailer Developer Documentation