# Firestore, Firebase Auth & Realtime DB

UI Bakery allows you to easily connect to Firebase Admin API with no need for additional layers like APIs or third-party services. It's possible to connect to **Firestore**, **Firebase Auth**, and **Firebase Realtime DB**.

In this article, we'll explore how you can [configure](#configuration) these data sources and [work](#usage) with them.

If you want to dive deeper and learn more about Firebase possibilities with UI Bakery, make sure to check out these articles:point\_down:

<table data-view="cards"><thead><tr><th data-type="content-ref"></th><th></th></tr></thead><tbody><tr><td><a href="/pages/m6EWRs2U8Rk0tkSz07Rq">/pages/m6EWRs2U8Rk0tkSz07Rq</a></td><td>Perform CRUD operations with Realtime DB &#x26; Firestore</td></tr><tr><td><a href="/pages/x4ZEBXLmqla34m1GM3ub">/pages/x4ZEBXLmqla34m1GM3ub</a></td><td>Provide authentication to your database in UI Bakery</td></tr><tr><td><a href="/pages/BsdQ2Bhk1XQK1D7BZDKO">/pages/BsdQ2Bhk1XQK1D7BZDKO</a></td><td>Connect from the client</td></tr><tr><td><a href="/pages/94ZiFl43UlY88f4RmkT6">/pages/94ZiFl43UlY88f4RmkT6</a></td><td>Connect Firebase libraries for more capabilities</td></tr></tbody></table>

## Configuration

### Prerequisites

Before connecting to your Firebase services, you will need to obtain one or several of the credentials listed below:

* **Firebase project ID**

Navigate to the Firebase console and copy the *project ID* of the required project.

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

* **Firebase database URL**

Navigate to your project and select Realtime DB in the left side menu - you'll need to copy the *project URL* there and save it for later.

{% hint style="info" %}
The URL pattern is `https://your_project.firebaseio.com/`.
{% endhint %}

* **Private key**

Navigate to *Project settings* > *Service accounts*. There, select **Firebase Admin SDK** and click **Generate new private key**.

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

### Connecting the data source

Once you've obtained the necessary credentials, you can proceed to connecting the data source:

1. On the **Data sources** page, click **Connect**, and select *the necessary option* in the Data sources list - *Firestore*, *Firebase Auth*, or *Firebase Realtime DB*.
2. Next, specify the required credentials:
   1. For **Firestore**, specify the *private key* and the *project ID*.
   2. For **Firebase Auth**, specify the *private key*.
   3. For **Firebase Realtime DB**, specify the *private key* and the *Firebase database URL*.
3. Click **Test connection** to check whether the data source can be connected, and then click **Connect Datasource** to complete the setup.

## Usage

Once you've connected the data source, you can start interacting with its data. For this purpose, you can use the [Firebase Query](/reference/working-with-actions/firebase-query.md) action step.


---

# 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://docs.uibakery.io/reference/data-sources/firebase.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.
