# 4.5 Firebase Configuration

<figure><img src="/files/2g3xCpEwnIZSkz9V2bRT" alt=""><figcaption></figcaption></figure>

### 4.5.1 Create Firebase Project

1. First, you need to go to Firebase consoles [***https://firebase.google.com/***](https://firebase.google.com/) as shown in the image below.

<figure><img src="/files/S8HpqeQxgVFeGcEwUzNW" alt=""><figcaption></figcaption></figure>

2. Thereafter, click on ‘**Add Project**’ to create a new project.

<figure><img src="/files/SICYJXEkGT9cRvjDCYdq" alt=""><figcaption></figcaption></figure>

3. Enter the name of your project and click on continue.

<figure><img src="/files/IPdpAvzW3cMyMwrD7XXZ" alt=""><figcaption></figcaption></figure>

4. In this step, if you have enabled Google Analytics, then select an account for Google Analytics by clicking on ‘**Continue**’ and following that, click on the ‘**Create Project**’ button. If Google Analytics is disabled, then directly click on ‘**Create Project**’. It is not necessary to enable Google Analytics for our product.

<figure><img src="/files/Te9yBpiWUW7TRSYUJuf0" alt=""><figcaption></figcaption></figure>

### 4.5.2 Setup Firebase & Admin SDK

1. After creating the project, click on ‘**Project Settings**’ as shown in the image below.

<figure><img src="/files/uT8W7I6OXjZPbePlnzN8" alt=""><figcaption></figcaption></figure>

2. Click on ‘**\</>**’ ‘**Web app create**’ button as shown in the image below.

<figure><img src="/files/iMi5lefR0Qktc6swSOQj" alt=""><figcaption></figcaption></figure>

3. Enter the name of your Web App as shown in the image below and click on the ‘**Register app**’ button.

<figure><img src="/files/QhbKuyTnSZ7oNFQNZ3u3" alt=""><figcaption></figcaption></figure>

4. Now, you need to Get Firebase credentials. Add these credentials in the form field as shown in the example below.\
   \ <mark style="color:red;">**APIKEY = "apiKey\_get\_from\_firebaseConfig"**</mark>

   <mark style="color:red;">**AUTODOMAIN = "authdonain\_get\_from\_firebaseConfig"**</mark>

   <mark style="color:red;">**PROJECTID = "projectId\_get\_from\_firebaseConfig"**</mark>

   <mark style="color:red;">**STORAGEBUCKET ="storageBucket\_get\_from\_firebaseConfig"**</mark>

   <mark style="color:red;">**MESSAGINGSENDERID ="messagingSenderId\_get\_from\_firebaseConfig"**</mark>

   <mark style="color:red;">**APPID = "appId\_get\_from\_firebaseConfig"**</mark>

   <mark style="color:red;">**MEASUREMENTID = 'add\_if\_get\_from\_firebaseConfig'**</mark>

   <mark style="color:red;">**otherwise\_add=""(empty string)**</mark><br>
5. Now, click on the ‘**Continue to Console**’ button.<br>

   <figure><img src="/files/cOEW7zFuxGAJ9OL7Gw86" alt=""><figcaption></figcaption></figure>
6. Thereafter, click on service accounts as shown in the image below.

<figure><img src="/files/z0wcFpolNFt6Bl5k1EyS" alt=""><figcaption></figcaption></figure>

7. Click on the ‘**Generate New Private Key**’ button. It downloads one JSON file. Now copy that JSON file and paste it into <mark style="color:red;">**firebase-adminsdk.json**</mark> file which is in the root folder of your code.

<figure><img src="/files/J5zrKfQxS4ztxq0Wzss6" alt=""><figcaption></figcaption></figure>

### 4.5.3 Setup FCM SERVER KEY

1. In Project Settings, go to the ‘**Cloud Messaging**’ tab. Now, click on the 3 dots in the ‘**Cloud Messaging API**’ section and click on the ‘**Manage API in Google Cloud Console**’ option.

<figure><img src="/files/ddg6tkEauud7m9XbVYDC" alt=""><figcaption></figcaption></figure>

2. Enable ‘**Cloud Messaging**’ as shown in the image below.

<figure><img src="/files/3M24LGjnyXbB7OcQp3Ch" alt=""><figcaption></figcaption></figure>

3. Thereafter, search for the `Firebase Cloud Messaging Data API`, and enable it.

<figure><img src="/files/UksSCyvlEBYvItP6Mjxs" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.alianhub.com/app-installation-and-start-guide/4.-installation-guide/4.5-firebase-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
