Nehal
Nehal

Reputation: 1489

How to upload multiple users to firebase auth?

I am using Firebase authentication, and I need to create above hundreds of User Accounts with email and password. Is there any way to do this without manually creating users in the console's website.

Upvotes: 0

Views: 924

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599176

You'll want to use either the Firebase Admin SDK to create the user accounts, or use the Firebase CLI or Admin SDK to import them from a file.

With the Admin SDK you can create the user accounts through code like this:

user = auth.create_user(
    email='[email protected]',
    email_verified=False,
    phone_number='+15555550100',
    password='secretPassword',
    display_name='John Doe',
    photo_url='http://www.example.com/12345678/photo.png',
    disabled=False)

The above is for Node.js, but the SDK is also available for other platforms.

If you already have the users defined in a file somewhere, you can import them through the Admin SDK too, or by using the Firebase CLI.

Upvotes: 2

Related Questions