DEV Community

Will Ceolin
Will Ceolin

Posted on • Updated on


How to delete all users from Firebase

Sometimes we need to wipe out our entire Firestore database. When that happens, it might also be useful to delete all existing users from the Firebase console.

As far as I know, we can't do that using the CLI. However, we can create a Cloud Function with an HTTPS trigger to delete all users:

export const deleteUsers = functions.https.onRequest(
  async (req, res): Promise<any> => {
    const allUsers = await auth.listUsers();
    const allUsersUID = => user.uid);
    return auth.deleteUsers(allUsersUID).then(() => res.send("deleted"));
Enter fullscreen mode Exit fullscreen mode

Follow me on Twitter

Top comments (0)

50 CLI Tools You Can't Live Without

The top 50 must-have CLI tools, including some scripts to help you automate the installation and updating of these tools on various systems/distros.