Skip to content

Integrate Firebase Phone Authentication seamlessly with Next.js for efficient web apps. Next.js provides server-side rendering and routing while Firebase offers secure phone number verification via SMS. Leverage this combo for dynamic, scalable apps with robust user authentication.

Notifications You must be signed in to change notification settings

Mratashnejad/firebase-phone-auth

Repository files navigation

Firebase Phone Authentication with Next.js

This project demonstrates how to implement Firebase Phone Authentication with Next.js.

Installation

  1. Install dependencies using pnpm:

    pnpm install

2.Run the project:

 pnpm dev .

Firebase Setup

Go to the Firebase Console Click "Get Started", then "Add project". Enter a project name and follow the steps to create the project. Once your project is created, click on "Web" to register your app. Give your app a name and copy the Firebase configuration code.

// config.js

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: "your-api-key",
  authDomain: "your-auth-domain",
  projectId: "your-project-id",
  storageBucket: "your-storage-bucket",
  messagingSenderId: "your-messaging-sender-id",
  appId: "your-app-id",
  measurementId: "your-measurement-id"
};

export default firebaseConfig;

Paste the Firebase configuration into config.js in your project. Firebase Authentication Setup In the Firebase Console, navigate to Authentication. Click "Get Started", then "Phone". Enable Phone Authentication and save the changes. Running the Code After setting up Firebase and configuring the project:

Run the project using: bash Copy code pnpm dev Open your browser and navigate to the specified URL to view the application.

About

Integrate Firebase Phone Authentication seamlessly with Next.js for efficient web apps. Next.js provides server-side rendering and routing while Firebase offers secure phone number verification via SMS. Leverage this combo for dynamic, scalable apps with robust user authentication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published