> For the complete documentation index, see [llms.txt](https://react-firebase.gitbook.io/rf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://react-firebase.gitbook.io/rf/react-firebase-auth/api.md).

# API

React bindings for Firebase auth API.

### Docs moved to : [https://react-firebase-js.com/docs/react-firebase-auth/api](https://react-firebase-js.com/docs/react-firebase-realtime-database/api)

### FirebaseAuthProvider Props

| Name              | Type                                               | Required | Default |
| ----------------- | -------------------------------------------------- | -------- | ------- |
| firebase          | [firebase](https://www.npmjs.com/package/firebase) | yes      |         |
| authDomain        | string                                             | yes      |         |
| apiKey            | string                                             | yes      |         |
| databaseURL       | string                                             | yes      |         |
| projectId         | string                                             | yes      |         |
| messagingSenderId | string                                             | no       |         |
| storageBucket     | string                                             | no       |         |
| children          | React Node                                         | no       |         |
| render            | () => ReactNode                                    | no       |         |

### [Firebase Auth Reference](https://firebase.google.com/docs/auth/)

### FirebaseAuthConsumer

| Name     | Type                       | Required | Default |
| -------- | -------------------------- | -------- | ------- |
| children | ({authState}) => ReactNode | no       |         |
| render   | ({authState}) => ReactNode | no       |         |

### authState

| Name       | Type                                                         |
| ---------- | ------------------------------------------------------------ |
| isSignedIn | boolean                                                      |
| providerId | 'none' \| 'anonymous' \| 'google.com' \| 'facebook.com' .... |
| user       | user \| null                                                 |

* isSignedIn: boolean
* providerId: 'none' | 'anonymous' | 'google.com' | 'facebook.com' ....
* user: null | user

### IfFirebaseAuthed

Only renders when a user is authenticated

| Name     | Type                       | Required | Default |
| -------- | -------------------------- | -------- | ------- |
| children | ({authState}) => ReactNode | no       |         |
| render   | ({authState}) => ReactNode | no       |         |

#### [authState](/rf/react-firebase-auth/api.md#authstate)

### IfFirebaseAuthedAnd

Only renders when a user is authenticated AND when the filter function passed as prop returns true

| Name     | Type                       | Required | Default |
| -------- | -------------------------- | -------- | ------- |
| children | ({authState}) => ReactNode | no       |         |
| render   | ({authState}) => ReactNode | no       |         |
| filter   | (authState) => boolean     |          |         |

#### [authState](/rf/react-firebase-auth/api.md#authstate)

### IfFirebaseAuthedOr

Only renders when a user is authenticated OR when the filter function passed as prop returns true

| Name     | Type                       | Required | Default |
| -------- | -------------------------- | -------- | ------- |
| children | ({authState}) => ReactNode | no       |         |
| render   | ({authState}) => ReactNode | no       |         |
| filter   | (authState) => boolean     |          |         |

#### [authState](/rf/react-firebase-auth/api.md#authstate)

### IfFirebaseUnAuthed

Only renders when a user is unauthenticated

| Name     | Type                       | Required | Default |
| -------- | -------------------------- | -------- | ------- |
| children | ({authState}) => ReactNode | no       |         |
| render   | ({authState}) => ReactNode | no       |         |

#### [authState](/rf/react-firebase-auth/api.md#authstate)
