-
Notifications
You must be signed in to change notification settings - Fork 0
Firebase emulator guide
Tri edited this page Mar 17, 2023
·
4 revisions
Install firebase CLI tool: Docs: https://firebase.google.com/docs/emulator-suite/install_and_configure
- Install:
npm i -g firebase-tools
- Open terminal and run:
firebase login
and complete login step
- Open terminal and cd to folder that contains the project, or if you use VSCode, just open project with VSCode
- Run command:
firebase init
- Use arrow key to move, and press space at emulators to choose, press enter to coninue
- Choose
Emulators
- Choose
Authentication Emulator
- Add env:
FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099
for firebase to know to use emulator - Complete other steps
- Run command
firebase emulators:start
to start emulator of current firebase project
- Go to
http://127.0.0.1:4000/auth
and add user with email, phone, password - Use this curl and change data like above to get token:
curl --location -g 'http://localhost:9099/identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[API_KEY]' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "",
"password": "",
"returnSecureToken": true
}'