# Firebase

At present, firebase uses you need to set a secret in the following file. For more detail refer to firebase here: <https://firebase.google.com/docs/reference/rest/auth>

1. **Set Firebase Config in .env**

{% code title=".env" %}

```javascript
###
## Firebase - Google Auth 

VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=
###
```

{% endcode %}

2. **Change AuthProvider**

{% code title="..\src\App.jsx" %}

```javascript
// Replace at line 17
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
```

{% endcode %}

3. **Change auth Hooks**

Comment another context in the following file and uncomment Firebase one.

{% code title="..\src\hooks\useAuth.js" %}

```javascript
import AuthContext from 'contexts/FirebaseContext';
```

{% endcode %}

4. **Replace Login Code**

It's super simple. We have provided a code that just needs to be replaced.

* **VITE**:
  * From: `src\views\pages\authentication\login\FirebaseLogin`&#x20;
  * To: `src\views\pages\authentication\auth-forms\AuthLogin.tsx`
* **NEXTJS**:
  * From: `src\components\Authentication\login\FirebaseLogin`
  * To: `src\components\Authentication\auth-forms\AuthLogin.jsx`

5. **Replace Register Code**

* **VITE**:
  * From: `src\views\pages\authentication\register\FirebaseRegister`&#x20;
  * To: `src\views\pages\authentication\auth-forms\AuthRegister.jsx`
* **NEXTJS**:
  * From: `src\components\Authentication\register\FirebaseRegister`
  * To: `src\components\Authentication\auth-forms\AuthRegister.jsx`


---

# 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://codedthemes.gitbook.io/berry/v3.9.0/authentication/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.
