Manage users

We manage users with the Auth Admin-SDK:

import { getAuth } from "firebase-admin/auth"
const auth = getAuth()

list users

listUsers() fetches at most 1000 users at once. If we have more users, we use pagination.

const result = await auth.listUsers() // implied 1000 max
const users = result.users

users.forEach((user) => {
    user // UserRecord

    user.uid
    user.email

    // HTTP-date string (RFC 1123)
    user.metadata.creationTime // "Tue, 13 Jun 2023 17:00:00 GMT"
    user.metadata.lastSignInTime // "Wed, 14 Jun 2023 17:00:00 GMT"
})
earlymorning logo

© Antoine Weber 2026 - All rights reserved

Manage users

We manage users with the Auth Admin-SDK:

import { getAuth } from "firebase-admin/auth"
const auth = getAuth()

list users

listUsers() fetches at most 1000 users at once. If we have more users, we use pagination.

const result = await auth.listUsers() // implied 1000 max
const users = result.users

users.forEach((user) => {
    user // UserRecord

    user.uid
    user.email

    // HTTP-date string (RFC 1123)
    user.metadata.creationTime // "Tue, 13 Jun 2023 17:00:00 GMT"
    user.metadata.lastSignInTime // "Wed, 14 Jun 2023 17:00:00 GMT"
})