Appearance
hailer.user
Read users. Results are scoped by app kind.
| Method | Host op | Returns |
|---|---|---|
current() | user.current | Promise<User> |
get(userId) | user.get | Promise<User | null> |
list() | user.list | Promise<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.