# Firebase client-side SDK

If necessary, you can enable specific Firebase capabilities in UI Bakery, for example, connecting to your app from the client. In this article, we'll explore the steps you need to take both in your Firebase app and in UI Bakery since a specific configuration is required.

## Prerequisites

Open your [Firebase app](https://console.firebase.google.com/u/0/) and navigate to *Project Settings* > *SDK setup and configuration*. Select the *Config* option and copy the setup script to be used later for integration.

{% hint style="danger" %}
Do **NOT** copy the `const firebaseConfig =` part.
{% endhint %}

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

If there is no web app connection available, you need to create it.

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

Below is an example of what a setup script might look like:

```javascript
const firebaseConfig = {
  apiKey: "AIzaSyDyWoZsfx4XnpCQ89Sf1BkDTTSWwV4m244",
  authDomain: "fir-webinar-39878.firebaseapp.com",
  databaseURL: "https://fir-webinar-39878-default-rtdb.firebaseio.com",
  projectId: "fir-webinar-39878",
  storageBucket: "fir-webinar-39878.appspot.com",
  messagingSenderId: "345464345951",
  appId: "1:345464345951:web:1f33b5a91d6d954bc512ea"
};
```

## Connecting the data source

Now, in UI Bakery, open the project you need in the Builder and click on the **Custom code** tab in the footer panel. There, insert the Firebase connection code together with the configuration you copied in the previous section:

```html
<script src="https://www.gstatic.com/firebasejs/9.10.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.10.0/firebase-firestore-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.10.0/firebase-auth-compat.js"></script>

<script>
  firebase.initializeApp(Firebase config goes here);
</script>
```

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

***

If you need to enable other Firebase capabilities, you can connect the corresponding Firebase library. You can find all available libraries listed [here](/reference/data-sources/firebase/firebase-libraries.md).


---

# 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/firebase-1.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.
