# firebase-provider-stats

> Tiny CLI tool to get provider stats for firebase

Latest version **1.0.3** (published 2025-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebase-provider-stats
pnpm add firebase-provider-stats
yarn add firebase-provider-stats
bun add firebase-provider-stats
```

Provides the command `firebase-provider-stats`.

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2025-02-20 |
| First published | 2022-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 102.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | David Dikman |
| Maintainers | ddikman |

## Links

- npm: https://www.npmjs.com/package/firebase-provider-stats
- Repository: https://github.com/ddikman/firebase-provider-stats
- Homepage: https://github.com/ddikman/firebase-provider-stats#readme
- Issues: https://github.com/ddikman/firebase-provider-stats/issues
- npm.io page: https://npm.io/package/firebase-provider-stats

## Dependencies (2)

- [mocha](https://npm.io/package/mocha.md) ^9.2.0
- [commander](https://npm.io/package/commander.md) ^9.0.0

## Recent versions

- 1.0.3 (latest) — 2025-02-20
- 1.0.2 — 2025-02-20
- 1.0.1 — 2022-02-12
- 1.0.0 — 2022-02-12

## README

# firebase-provider-stats

Tiny nodejs based tool to calculate some quick stats based on Firebase Auth.

![Example usage](./example.png)

## Why this project?

Because I needed to figure out if my Facebook provider was still worth having in my project or if I could safely just wipe it by looking at the number of users that was registered with Facebook.

Firebase auth is amazing at removing the pain of authentication handling and securing logins. However, when it comes to providing data about who is registered, you need to add some effort yourself.

## Usage

First, you need to download your auth data. This is most easily done using the [firebase cli](https://firebase.google.com/docs/cli):

```bash
firebase --project <optional> auth:export users.json
```

Then you run this little tool to get the data out:

```bash
npm install -g firebase-provider-stats
firebase-provider-stats users.json
```

## Details about the stats

This tool is at the mercy of what data the firebase user export provides. This means, email and phone registrations cannot be easily detected as these simply get added as data to the user object rather than as providers.

In order to count the email and phone logins, the existance of these fields are compared. Email is registered for any provider that is added with email as well, so I consider it a user with email login only if no providers are given.

⚠️ For Apple ids, we do not get the provider details in the json so we have to rely on checking if the registered email is an `appleid.com` relay email. This is not a perfect solution but it's the best we can do for now.

## Build

To install dependencies and run locally:

```
npm install
npm link
firebase-provider-stats <your-file>
```

And to test:
```
npm test
```

This will use the provided example testfile `example.json`.

## Publishing

Publishing to NPM is done automatically by any tag.

1. Update version in [package.json](package.json)
2. Tag it with `git tag vx.x.x` and `git push origin vx.x.x`
3. Sit back and let it build

## Credits

Big shoutout to [LogRockets article on creating CLI tools](https://blog.logrocket.com/creating-a-cli-tool-with-node-js/)

## License
The MIT License (MIT)

---
_Source: https://npm.io/package/firebase-provider-stats · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
