The Firebase Auth quickstart demonstrates several methods for signing in:
- The Firebase phone number authentication demonstrates using Firebase phone number authentication with a visible ReCaptcha.
- The Firebase Google Sign in demonstrate using a Google account to authenticate to Firebase with a popup page.
-
Create a Firebase project on the Firebase Console.
[Firebase Console > Project Settings > General > Web app > SDK setup and configuration]
Copy the Firebase config object and paste it in the
firebase/config.jsfile to replace the template. -
You must have the Firebase CLI installed.
If you don't have it, install it with
npm install -g firebase-toolsand then configure it withfirebase login. -
On the command line,
cdinto the repo. -
Run
firebase use --addand select your Firebase project.
- Run
npm installto install dependencies. - Run
firebase emulators:startto start the local Firebase emulators. Note: phone authentication required ReCaptcha verification which does not work with the Firebase emulators. These examples skip connecting to the emulators. - Run
npm run devto serve the app locally using Vite This will start a server locally that servesindex.htmlonhttp://localhost:5174/index.html.
- Run
npm installto install dependencies. - Run
npm run buildto build the app using Vite. - Run
firebase emulators:startto start the local Firebase emulators. Note: phone authentication required ReCaptcha verification which does not work with the Firebase emulators. These examples skip connecting to the emulators. - In your terminal output, you will see the "Hosting" URL. By default, it will be
127.0.0.1:5002, though it may be different for you. - Navigate in your browser to the URL output by the
firebase emulators:startcommand.
