Set custom claims for Firebase Auth users from values set in Firestore.
### How this function works
This function will automatically sync data from the specified collection to custom claims on a corresponding Firebase Auth user.
### Prerequisites
- You must have previous knowledge of **Firestore**.
- You must have previous knowledge of **Firebase Auth**.
### Function details
In order to complete the installation process, you must add the required info to the form:
- **Document Path**: The document path that you'd like this function to listen to. A placeholder should be used for the document ID (e.g., /collection/{docId}).
- **CLAIMS_FIELD**: The name of the document field where the custom claims will be stored.
> Leave **CLAIMS_FIELD** blank to use all data in the document as custom claims. Custom claims must be an object.
The following is an example of how to use this function:
```
CLAIMS_FIELD:{
role: "admin",
groups: ["example1", "example2"]
}
```
Once the document has been written, the extension will automatically set the same custom claims (in this case, role and groups) on the Firebase Auth user with a UID corresponding to the document ID. Then in a few seconds, you will see a `_synced` field appear with the timestamp of when the claims were set.
```
_synced: Mon Dec 27 2021 00:59:31 GMT-0600
```
### Resources
- [Custom Claims](https://firebase.google.com/docs/auth/admin/custom-claims)