firebase-admin-node

Firebase Admin Node.js SDK for privileged, server-side access to Firebase Authentication, Firestore, Realtime Database, Cloud Messaging, and Storage.

SDK
npm
v14.3.0
1,748stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
96/100Excellent
Development Activity96
Maintenance96
Community92
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture82
Code Quality85
Innovation75
Learning Curve50

firebase-admin is Google’s official Node.js SDK for accessing Firebase services from privileged backend environments — servers, Cloud Functions, and other trusted infrastructure that a developer controls. It wraps the OAuth2 and REST/gRPC surfaces of Firebase Authentication, Firestore, the Realtime Database, Cloud Messaging, Cloud Storage, Remote Config, App Check, and several other Firebase and Google Cloud products behind one consistent, per-service module API.

Rather than each app re-implementing token minting, service-account credential handling, and per-product REST clients, the SDK centralizes app initialization and credential management in a single FirebaseApp/Credential layer, then exposes each Firebase product as its own subpath export (firebase-admin/auth, firebase-admin/firestore, firebase-admin/messaging, etc.) so consumers only pull in the pieces they use. It is explicitly not meant for browser or client-side use — its whole reason to exist is privileged operations like verifying ID tokens, minting custom tokens, sending push notifications, and managing users and security rules from trusted server code.

What You Get

  • A single initializeApp() entry point that wires one credential (service account JSON, refresh token, or Application Default Credentials) to every Firebase product you use
  • Per-service subpath modules (firebase-admin/auth, firebase-admin/firestore, firebase-admin/database, firebase-admin/messaging, firebase-admin/storage, firebase-admin/remote-config, firebase-admin/app-check, and more) so bundlers only include what’s imported
  • Server-side Firebase Authentication: verify ID tokens, mint custom tokens, manage users, and configure tenants/multi-tenancy without exposing service-account keys to clients
  • Cloud Messaging (FCM) send/broadcast APIs for pushing notifications to devices, topics, and condition-matched audiences directly from backend jobs
  • Delegation to the official @google-cloud/firestore and @google-cloud/storage client libraries (as optional dependencies) instead of reimplementing those wire protocols
  • Generated, versioned TSDoc API reference (via @microsoft/api-extractor and the api-documenter pipeline) kept in sync with the shipped TypeScript types

Common Use Cases

  • Verifying a Firebase ID token on an API route or Cloud Function to authorize a request before touching backend data
  • Sending push notifications to users or topics from a scheduled job or webhook handler via Cloud Messaging
  • Bulk-importing or migrating user accounts into Firebase Authentication from an existing identity system
  • Reading and writing Firestore or Realtime Database data from trusted server code, bypassing client-side security rules where the server itself is the trust boundary
  • Managing Firebase Remote Config parameters or Security Rules programmatically as part of a deployment pipeline

Under The Hood

Architecture The SDK centers on a small app-lifecycle layer in src/app (core.ts, lifecycle.ts, firebase-app.ts, credential.ts) that owns exactly one authenticated FirebaseApp instance per initialized app, with FirebaseAppInternals caching and transparently refreshing the underlying OAuth access token ahead of expiry for every downstream call. Every Firebase product then lives in its own top-level directory (auth/, firestore/, database/, messaging/, storage/, remote-config/, app-check/, eventarc/, extensions/, data-connect/, functions/, installations/, machine-learning/, project-management/, security-rules/) with its own index.ts, request/manager classes (e.g. auth/base-auth.ts, auth/auth-api-request.ts, auth/token-verifier.ts), and error types, and each is exposed as its own package.json subpath export so a consumer importing firebase-admin/auth does not pull in Firestore or Storage code. Credential injection (the Credential interface, implemented by service-account, refresh-token, and Application Default Credential variants in credential-factory.ts) is the one dependency every module shares, which is what would break broadest if it changed.

Tech Stack The codebase is near-entirely TypeScript (99% by bytes) targeting Node.js 22+, built with Gulp and compiled/typed-checked via tsc, with public API surfaces tracked by Microsoft’s api-extractor and rendered into docs through Firebase’s own api-documenter tooling. Rather than reimplementing Google Cloud wire protocols, Firestore and Cloud Storage access is delegated to the official @google-cloud/firestore and @google-cloud/storage clients as optional dependencies, while google-auth-library handles OAuth2, and jsonwebtoken/jwks-rsa handle Firebase Auth token signing and verification; @firebase/database-compat backs the Realtime Database module.

Code Quality Test coverage is extensive: 83 spec files under test/unit mirror the src/ module layout one-to-one, built on mocha, chai/chai-as-promised, sinon/sinon-chai, and nock for HTTP-level mocking, with nyc wired up for coverage reporting and a separate test/integration suite against live Firebase projects. Errors are modeled as typed classes (FirebaseAppError, FirebaseError) carrying stable error codes rather than being thrown as bare strings or swallowed, private instance state follows a consistent trailing-underscore naming convention, and eslint/typescript-eslint plus a GitHub Actions CI badge gate contributions.

API Design The SDK’s main ergonomic choice is treating each Firebase product as an independently importable, tree-shakeable subpath behind one shared initializeApp() call, so a Cloud Functions deployment that only sends push notifications doesn’t bundle Firestore or Auth code paths. Naming is consistent across products (verbs like get, create, update, delete map predictably onto each service’s manager class), and the generated TSDoc reference keeps documentation directly tied to the shipped type definitions rather than hand-maintained separately — solid, if fairly conventional, SDK design rather than a novel API paradigm.

Used by 10 apps in this directory

JavaScript
99%
Other

ChartBrew

Analytics · Databases

4,054

Open-source reporting platform to build live dashboards from SQL, NoSQL, APIs, and SaaS tools with an AI assistant that creates charts from natural language.

View details
90
Repo Health
83
Technical
64
Dependency
Built with
JavaScript99%
Updated 4 days ago
JavaScript
83%
Other

Countly

Analytics · Marketing

5,896

Privacy-first, self-hosted analytics and customer engagement platform with full data ownership, GDPR compliance, and AI-powered insights across mobile, web, desktop, and IoT.

View details
95
Repo Health
82
Technical
65
Dependency
Built with
JavaScript83%
Updated 3 days ago
TypeScript
92%
MIT

Dittofeed

Marketing · Automation

2,926

Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.

View details
54
Repo Health
75
Technical
62
Dependency
Built with
TypeScript92%
Updated 5 months ago
JavaScript
88%
GPL 3.0

Glass by Pickle

AI Assistants

7,598

A privacy-first desktop AI assistant that sees your screen, hears your meetings, and turns live context into structured summaries—without sending a single byte to the cloud.

View details
43
Repo Health
76
Technical
67
Dependency
Built with
JavaScript88%
TypeScript12%
Updated 10 months ago
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,372

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 2 weeks ago
TypeScript
57%
MIT

Jitsu

Data Engineering

5,063

Open-source, fully-scriptable data ingestion engine that streams events from web, apps, and APIs to any data warehouse in real time.

View details
88
Repo Health
79
Technical
66
Dependency
Built with
TypeScript57%
Go41%
Updated 3 days ago
TypeScript
94%
AGPL 3.0

Laudspeaker

Marketing · Automation

2,620

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
51
Repo Health
66
Technical
62
Dependency
Built with
TypeScript94%
Updated 1 months ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,743

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
88
Repo Health
73
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
98%
Other

Novu

Developer Tools

39,870

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript98%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search