> For the complete documentation index, see [llms.txt](https://docs.uibakery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uibakery.io/reference/data-sources/firebase/firebase-1.md).

# 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="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FCbZuqVhvG3rnlI3svuUd%2Fspaces_UX6zPRMFFK0yrTghj7cY_uploads_git-blob-3eaac944edd55b63b82624c3860d86def889e14e_Screenshot%202021-09-16%20at%2016.30.11-min.png?alt=media&amp;token=79dc3015-387b-4c57-a5df-2e94e6357015" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FQ9BCZhRhLWnGwtilcSPV%2Fspaces_UX6zPRMFFK0yrTghj7cY_uploads_git-blob-78cbf5f6b059f38dce76c62c56376dc084179398_Screenshot%202021-09-16%20at%2016.37.53-min.png?alt=media&amp;token=3b820d56-e9a2-4822-8a66-e72d4f7aa5c0" 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="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FaMTU55JVfFxwyPhXXYT4%2FCleanShot%202025-04-15%20at%2014.52.50%402x-min.png?alt=media&amp;token=f0346bc2-ddfc-4e75-8e5c-9b8529377822" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uibakery.io/reference/data-sources/firebase/firebase-1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
