Search code examples
firebasereact-nativegoogle-cloud-platformgoogle-cloud-firestorefirebase-authentication

adding Hard-Coded Users to Firestore in React Native Firebase"


I'm developing a React Native application that requires pre-populating Cloud Firestore with user data obtained after authentication. The user flow involves first going through authentication to create a username and password. Following this, users need to provide additional details such as age, location, and upload photos. To facilitate testing and development, I'm seeking guidance on the best approach to add this hard-coded user data to Firestore within the context of a React Native Firebase project. Any insights or suggestions on how to efficiently achieve this would be greatly appreciated.

I encountered challenges in determining the most effective approach to accomplish this task, leading to uncertainty about the correct implementation method.


Solution

  • To facilitate testing and development, I'm seeking guidance on the best approach to add this hard-coded user data to Firestore within the context of a React Native Firebase project.

    To achieve this, you can manually create the users, effectively authenticating x number of times using the web client or you can create new Firebase Authentication users programmatically, using the Admin SDK.