Skip to main content

sdk.asAdmin().Auth()

Read-only access to the tenant's users and user groups. Only available for the app context, not for asUser.

Users.list()​

const { status, result } = await sdk.asAdmin().Auth().Users.list()

GET /api/v1/users. Returns an array sorted by displayName:

FieldDescription
uidUser id
email, emailVerified, verificationMethod
displayName, photoURL
signedUpAt, lastSeenAt
isOwner, isAdminRoles
customClaimsEffective claims, merged with the claims of the user's groups
userGroups[{ name, assignmentMethod }]
registrationStatus

UserGroups.list()​

const { result } = await sdk.asAdmin().Auth().UserGroups.list()
// [{ gid: '…', name: 'Sales', assignOnRegister: false }]

GET /api/v1/userGroups.

Example: map users to a group​

const auth = sdk.asAdmin().Auth()

const { result: users } = await auth.Users.list()

const sales = users.filter(user => user.userGroups.some(group => group.name === 'Sales'))
console.log(sales.map(user => user.email))