Setup and Initialize Firebase Authentication



Follow the steps to Setup and Initialize Firebase Authentication for Web :

  1. Open firebase project console then navigate to Build > Authentication dashboard and open it.
  2. Click on Get Started and you will see 'sign-in provider' in Sign-in method tab. 
    Firebase authentication dashboard
  3. Now setup firebase SDK and initialize firebase authentication.

FirebaseConfig.js :
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';

const firebaseConfig = {
  // ...
  // ...
};

const app = initializeApp(firebaseConfig); // Initialize Firebase

export const auth = getAuth(app); // Initialize Firebase Authentication

Now just import 'auth' from 'firebaseCofig' file and use authentication functions in your app.
Related Post
Setup and Initialize
Setup and Initialize Firebase Authentication
Setup and Initialize Firebase Authentication

1.Add Firebase SDK, 2.Initialize app, 3.Iniitialize Authentication using getAuth(app)

21 October 2024

Email/Password
How to Signup/ Login/ Logout User In Firebase Authentication ?
How to Signup/ Login/ Logout User In Firebase Authentication ?

1.Create New User Account: 'createUserWithEmailAndPassword()' method, 2.Login: 'signInWithEmailAndPassword()' method, 3.Logout: 'signOut(auth)' method

21 October 2024

Phone number
Firebase Phone Number Authentication
Firebase Phone Number Authentication

1. Enable Phone Number sign-in for your Firebase project, 2. Set up the reCAPTCHA verifier, 3. Send a verification code to the user's phone, 4. Sign in the user by verifying OTP code

21 October 2024

Google OAuth
Sign-In User using Google OAuth with Firebase
Sign-In User using Google OAuth with Firebase

Step 1. Enable Google sign-in method for your project, Step 2. Set up Sign-in flow.

21 October 2024

Email link (Passwordless)
Authenticate User Using Email Link (Passwordless)
Authenticate User Using Email Link (Passwordless)

1. Enable Email Link sign-in method, 2. Send an authentication link to the user's email address, 3. Sign-In user

21 October 2024

Company
Explore

Copyright © 2024, All rights reserved by Firebase Master

We value your privacy

We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Allow", you consent to our use of cookies. Here is our Privacy Policy.