Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I list all users using firebase admin sdk

Is there a way to list all the users using the firebase admin sdk? Documentation only shows getting one user either by uid or email.

like image 692
vincent nyanga Avatar asked Dec 07 '16 07:12

vincent nyanga


People also ask

How do I get all users from Firebase authentication?

If you want to view a list of users that has registered thru Firebase Auth, you may view them in https://console.firebase.google.com/ then go to your project and select authentication , in the Users list is all the users that have registered thru Firebase Auth.

How can I get user details from Firebase?

If the user login with a custom "email/password" you don't know anything else about that user (apart from the unique user id). If a user login with Facebook, or with Google sign in, you can get other information like the profile picture url. It is explained here: firebase.google.com/docs/auth/android/… .

What is the use of Firebase admin SDK?

The Admin SDK is a set of server libraries that lets you interact with Firebase from privileged environments to perform actions like: Read and write Realtime Database data with full admin privileges.

Where are Firebase Auth users stored?

The user data for firebase authentication is stored in firebaseLocalStorageDb in IndexedDB .


1 Answers

The latest firebase-admin sdk (as of now version 5.4.2) has listUsers API that would do that. The example is here.

One thing to add to the example, the nextPageToken has to be omitted or a valid userid. (IMO, it's not obvious in neither the example or the API doc.)

like image 169
webp Avatar answered Sep 20 '22 14:09

webp