npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@echo-health/fb-auth-util

v0.0.7

Published

A firebase auth util cli

Downloads

3

Readme

Firebase auth util

A simple node.js command line tool for getting, adding, updating and removing firebase auth users.

Why?

The firebase admin library has more functionality then it's web console counter part. Mainly it has no way to automate auth actions.

This command line interface bridges this and allows users to easily integrate it in their process.

Installing

fb-auth-util can be installed locally or globally, whatever you prefer.

$ npm install @echo-health/fb-auth-util -g // global
$ npm install @echo-health/fb-auth-util

Or if you prefer yarn

$ yarn global add @echo-health/fb-auth-util  // global
$ yarn add @echo-health/fb-auth-util

CLI Options

At minimum you need to provide a path to a credentials file for your Firebase database. This can be provided in the --credentials option or via the GOOGLE_APPLICATION_CREDENTIALS environment variable. You can see all options by using --help:

$ fb-auth-util --help

  Usage: cli [options]

  Options:

    -c --credentials <credentials>  Path to your Firebase credentials file
    -j --json                       Output in json
    -t --type <type>                Type can be either get, add, update or remove.
    -u --user <user>                The user object. Value must be in json format.
    -h, --help                      output usage information

User object

  • uid String The uid of the user to update.
  • email String The user's primary email. Must be a valid email address.
  • emailVerified boolean Whether or not the user's primary email is verified. If not provided, the default is false.
  • password String The user's raw, unhashed password. Must be at least six characters long (only used when updating or adding).
  • displayName String The users' display name.
  • photoURL String The user's photo URL.
  • disabled boolean Whether or not the user is disabled. true for disabled; false for enabled. If not provided, the default is false.

Get

Only { "uid": "..." } or { "email": "..." } is used in the --user argument

Remove

Only { "uid": "..." } is used in the --user argument

Add

Only { "email": "..." } key is mandatory in the --user argument

Update

Only { "uid": "..." } is used in the --user argument and at least one other key needs to be included

Pipeing output into another program

One use case might be to pipe the results of the user object into another program, for example jq. You can acheive this by using the --json flag. For example:

$ fb-auth-util --type get --user '{"email": "[email protected]"}' --json | jq -r '.uid'
kxXIfDOXOuYmTG0YvBOIV9k4hdj2