firebase / firebase/firebase-admin-node

[FR] Add `returnUserInfo` to Admin SDK

Open
#2,573 1 comment 0 reactions 1 assignee Claimed by @lahirumaramba View on GitHub
api: auth type: feature request
Dominant language
TypeScript
Stars
1.7k
Forks
419
Avg merge
3d 10h
Merged PRs (30d)
16

Description

**Is your feature request related to a problem? Please describe.**
We currently cannot count the number of users using the Firebase Admin Auth SDK. However, this is available in REST API with more boilerplate.

**Describe the solution you'd like**
Add a `returnUserInfo` function to the Firebase Admin Auth SDK.

**Describe alternatives you've considered**
Running the REST API manually:
```ts
const url = `https://identitytoolkit.googleapis.com/v1/projects/${projectID}/accounts:query?alt=json`;
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token.access_token}`
},
body: JSON.stringify({
"returnUserInfo": false,
"expression": []
})
};

return await fetch(url, options).then(response => response.json());
```

**Additional context**
Should be simple to add.

J

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.