# Firebase Configuration

> How to configure Firebase projects, authentication, service accounts, and related setup required by Temp-Number App.


Follow these steps to configure Firebase project for the Temp-Number App:

## Backend Requirements

### Step 1: Create a Firebase Project

Create a new Firebase project or use an existing one in the [Firebase console](https://console.firebase.google.com/)
.

### Step 2: Enable Firebase Authentication

1. In the Firebase console, go to [Build → Authentication → Get Started](https://console.firebase.google.com/project/_/authentication)
.
2. Enable the authentication providers your users will need.



You can start with the Email/Password provider and add others as necessary.



### Step 3: Create Service Account and Key

Temp-Number Backend requires service account for Firebase Authentication and Notifications.

1. Go to [Firebase Cloud Console → Settings → Users and permissions → Service accounts](https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk)
.
2. Select your Firebase project.
3. Click on "Generate new private key" to download the service account key in JSON format.

### Step 4: Configure Firebase Auth Email Templates

Temp-Number App uses Firebase Authentication emails templates for user verification, password resets, and other authentication-related emails. To ensure users can verify their email addresses and reset passwords, configure the email templates in Firebase console:

1. In the Firebase console, go to [Build → Authentication → Templates](https://console.firebase.google.com/project/_/authentication/emails)
.
2. Edit "Email address verification" template by clicking on pencil icon.
3. Set the **Action URL** to your Temp-Number Web application URL followed by `/app/deeplink`. For example:

```shell
https://your-frontend.com/app/deeplink
```



`setup-wizard.sh` will automatically configure this URL for you.



## Android Configuration

To add Android app to your Firebase project, follow these steps:

- Follow the [Firebase setup documentation](https://firebase.google.com/docs/android/setup) to add an Android app to your project.
- Use a unique `applicationId` (e.g., `com.yourcompany.yourapp`).
- Download the `google-services.json` file.
- If using Google Sign-In, add your [SHA-1 fingerprint](https://developers.google.com/android/guides/client-auth) in **Project Settings > General > Your apps > Android**.

## iOS Configuration

To add iOS app to your Firebase project, follow these steps:

- Follow the [Firebase setup documentation](https://firebase.google.com/docs/ios/setup) to add an iOS app to your project.
- Download the `GoogleService-Info.plist` file and add it to your project.

