
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@e2fyi/firebase-admin
Advanced tools
cli
for firebase-admin.
Available Features
fb-admin project
)fb-admin users
)fb-admin claims
)# npm
npm install -g @e2fyi/firebase-admin
# yarn
yarn global add @e2fyi/firebase-admin
The cli
connects to a firebase project by loading the environment variable FIREBASE_SERVICE_ACCOUNT
from .env
. The .env
can be automatically generate with the fb-admin project <PATH_TO_PROJECT_CRED>
command.
Creating a service account and getting the project credentials
Service Accounts tab
in your project's settings page.Generate New Private Key
button at the bottom of the Firebase Admin SDK section of the Service Accounts tab.Example
# setup current project to
# `~/.firebase/firebase_service_account.json`
fb-admin project ~/.firebase/firebase_service_account.json
Additional resources:
# run cli and see help
fb-admin -h
usage: fb-admin [-h] [-v] {project,claims,users} ...
cli command to manage custom claims for firebase users.
Optional arguments:
-h, --help Show this help message and exit.
-v, --version Show program's version number and exit.
subcommands:
{project,claims,users}
project Setup credential for a firebase project.
claims Update the custom claims of a firebase user.
users List firebase users.
PROJECT
Select a project by providing the path to the service account credentials.
usage: fb-admin project [-h] cred
Positional arguments:
cred Path to the JSON credential for firebase project.
Optional arguments:
-h, --help Show this help message and exit.
Example
fb-admin project ~/.firebase/firebase_service_account.json
CLAIMS
Update the customClaims of a user.
usage: fb-admin claims [-h] [-d DATA] [-f FLAGS] email
Positional arguments:
email ptnet user email
Optional arguments:
-h, --help Show this help message and exit.
-d DATA, --data DATA Set the custom claims with the JSON string. e.g.
'{"admin":1}'
-f FLAGS, --flags FLAGS
Set a flag in custom claims with semicolon-delimited
<field=value> pairs. e.g. -f admin=1;scope=all;
Examples
# equivalent to -d {"admin": 1, "scope": "all"}
fb-admin claims someone@email.com -f admin=1;scope=all;
# equivalent to -f admin=1
fb-admin claims someone@email.com -d '{"admin":1}';
USERS
List or search users based on email.
usage: fb-admin users [-h] [-m MATCH]
Optional arguments:
-h, --help Show this help message and exit.
-m MATCH, --match MATCH
List only users with email matching the provided
minimatch pattern. e.g. *@email.com
Examples
# list all users
fb-admin users
# list all users with email domain "email.com"
fb-admin users -m *@email.com;
FAQs
CLI for firebase admin sdk
The npm package @e2fyi/firebase-admin receives a total of 0 weekly downloads. As such, @e2fyi/firebase-admin popularity was classified as not popular.
We found that @e2fyi/firebase-admin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.