Step 2: Set up Firebase Project
Sub-step 1: Create a Firebase account
To get started, follow these steps:
- Visit the Firebase Console.
- Click on "Add project".
- Select the Google Cloud project you set up in the first step.
- Continue and set up Google Analytics if desired.
Sub-step 2: Add Firebase to your web app
Follow these steps to integrate Firebase with your Next.js app:
- Click the </> button to add Firebase to your web app.
- Give your app a nickname and register the app.
- Ignore the npm install firebase command, as it comes preinstalled.
- Create a
firebase.ts
file in your root directory and paste the code provided by Firebase under the install command.
Sub-step 3: Set up Authentication
Configure authentication for your Firebase project:
- Go to Authentication and click "Get Started".
- For sign-in providers, select Google, enable it, and press save.
- Return to the project overview.
Sub-step 4: Set up Cloud Firestore
Initialize Cloud Firestore for your project:
- Click Cloud Firestore and select "Get Started".
- Leave defaults and press "Create".
- Choose to start in production and press "Create".
For more detailed instructions, refer to the Firebase Web Setup Guide.