# User Sign-up, Login, and Authentication via Firebase API

### **What you'll need**

* A Firebase project with Authentication enabled
* Your Firebase API key (found in your Firebase project settings)
* Email/password sign-in enabled in your Firebase Authentication settings

***

### Video Example

{% embed url="<https://youtu.be/OFdxD5h_nIE>" %}

### Sample Prompts

Copy any of the prompts below and paste it into the AI chat to add that feature to your app. It is recommended to start with Sign Up first.

#### Sign Up&#x20;

```
I want to use Firebase Auth API to handle account creation and login. 
This is the sample code from their API: curl 'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=[API_KEY]' \ -H 'Content-Type: application/json' \ --data-binary '{"email":"[user@example.com]","password":"[PASSWORD]","returnSecureToken":true}'
```

#### Sign In

```
Use Firebase's Auth API to handle user login
This is the sample code from their API: curl 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[API_KEY]'
-H 'Content-Type: application/json'
--data-binary '{"email":"[user@example.com]","password":"[PASSWORD]","returnSecureToken":true}'
```

#### Reset Password

```
Add a "forget password" that makes an api call. 
Here is the sample code: curl 'https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=[API_KEY]' \ -H 'Content-Type: application/json' \ --data-binary '{"requestType":"PASSWORD_RESET","email":"[user@example.com]"}'
```

#### Send Email Verification

```
When users create an account, send an email verification through an api call. 
The sample code is this: curl 'https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=[API_KEY]' \ -H 'Content-Type: application/json' \ --data-binary '{"requestType":"VERIFY_EMAIL","idToken":"[FIREBASE_ID_TOKEN]"}'
```

#### Confirm Email Verification

```
When trying to login, check to make sure that the email is verified before letting them login. 
Sample code here: curl 'https://identitytoolkit.googleapis.com/v1/accounts:update?key=[API_KEY]' \ -H 'Content-Type: application/json' --data-binary '{"oobCode":"[VERIFICATION_CODE]"}'
```


---

# 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.thunkable.com/ai/features/api/user-sign-up-login-and-authentication-via-firebase-api.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.
