> For the complete documentation index, see [llms.txt](https://aidocs.thunkable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aidocs.thunkable.com/features/api/user-sign-up-login-and-authentication-via-firebase-api.md).

# 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]"}'
```
