Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gupta-shrinath/a610eb47f1e0f35c35c7b13f0976448d to your computer and use it in GitHub Desktop.
Save gupta-shrinath/a610eb47f1e0f35c35c7b13f0976448d to your computer and use it in GitHub Desktop.
Delete all anonymous firebase users
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
from firebase_admin import auth
# Download the service account json from Project Setting > Service Accounts Generate Private Key
service_account = 'project.json'
cred = credentials.Certificate(service_account)
firebase_admin.initialize_app(cred)
for user in auth.list_users().iterate_all():
if user.email is None and user.phone_number is None:
auth.delete_user(user.uid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment