Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anatine/firebase-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anatine/firebase-utils

A few handy tools when working with Firebase

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

Firebase Utilities

Simple utilities to reduce some firebase-admin tasks.

Overview

getFirebaseAdmin(credential, realtimeDbUrl)

Easy function to initialize firebase-admin only once.

validateToken(token, firebaseAdminInstance)

Validates an idToken generated by Firebase Auth (not access token, idToken).

Also supports the format Bearer <token> or just <token>

getTestIdToken(firebaseAdminInstance, userId, claims)

Gets an Id Token from the Firebase Emulator.

Usage

An example of using all three tools

import { getFirebaseAdmin, validateToken, getTestIdToken } from '@anatine/firebase-utils'

const admin = getFirebaseAdmin();
const uid = 'SomeUserId'

const { idToken } = await getTestIdToken({admin, uid, claims: {status: 'this is awesome'}})

const decodedUserData = await validateToken(idToken, admin)

console.log(decodedUserData)

FAQs

Package last updated on 15 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc