Linked Questions

Popular Questions

Generate an Auth UID on User Import

Asked by At

I'm importing users from a MySQL database that used a sequential numeric ID for the user ID.

When importing into Firebase using the admin.auth().importUsers() method, I would prefer to provide a new user ID that closely resembles a Firebase generated Auth UIDs.

I know Firebase doesn't share their method of generating Auth UIDs but is there a method and specs I could use to generate a UID that is similar in appearance, length, and won't cause any collisions?

My fallback is to create an empty user, grab the generated UID from the empty user, and then delete that empty user. I can then use that generated Auth UID on my imported user, but clearly, this is a bit more resource intensive.

Related Questions