Firebase · sdk · fg-0184

admin.firestore is not a function after upgrading firebase-admin to v14

TypeError: admin.firestore is not a function

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

firebase-admin 14.0.0 removed the legacy namespace API, so the default import no longer carries firestore(), auth(), messaging(), credential, or apps. It also dropped Node.js 18 and 20.

Fix

Switch to the modular entry points (firebase-admin/app, /firestore, /auth, /messaging) and run on Node.js 22 or later.

Apply

import { initializeApp, getApps, cert } from 'firebase-admin/app';
import { getFirestore } from 'firebase-admin/firestore';
import { getAuth } from 'firebase-admin/auth';
const app = getApps()[0] ?? initializeApp({ credential: cert(serviceAccount) });
const db = getFirestore(app);
const auth = getAuth(app);

Affects: firebase-admin 14.0.0 and later (released 2026-06-08); requires Node.js 22+

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp