ax-check.com
by Gauge
F
Firebase
firebase.google.com
ax-check.com
Checked 18 September 2026
C
57/100
Agents need your login
Firebase setup and pricing are clear, but no quick-read guide exists
Docs, CLI, MCP server and pricing tables are all directly usable. But there's no llms.txt or Markdown version of the homepage for fast agent scanning.
4 fixes to start with
Concrete changes, backed by what we found.
https://firebase.google.com/llms.txt returned HTTP 404, so no documentation index exists.
Publish a text or Markdown version of the quickstart.
No compact guide representation: /llms.txt returns 404 and homepage serves HTML for Markdown requests.
Recorded coding sessions
Same task, 3 models, no firebase.google.com account. Recorded 18 September 2026 on Pi.
3 recorded · 6m 40s
6m 40s · recorded
Session findings
Select a finding to see it in context.
›Thinking…
The user wants to build a simple example using Firebase. They want to know how pricing works, and whether it's easy to manage. They want me to stay light, use hosted product through SDK/API. Let me explore the repo first to understand context.
Let me check the working directory.
✓$ ls -la && find . -maxdepth 2 -type f | head -50✓└{"content":[{"text":"total 16\ndrwxr-xr-x 3 root root 4096 Sep 18 08:00 .\ndrwxr-xr-x 7 root root 4096 Sep 18 22:08 ..\ndrwxr-xr-x 8 root root 4096 Sep 18 08:00…ctrl+o
{"content":[{"text":"total 16\ndrwxr-xr-x 3 root root 4096 Sep 18 08:00 .\ndrwxr-xr-x 7 root root 4096 Sep 18 22:08 ..\ndrwxr-xr-x 8 root root 4096 Sep 18 08:00 .git\n-rw-r--r-- 1 root root 408 Sep 18 08:00 .gitignore\n./.gitignore\n./.git/COMMIT_EDITMSG\n./.git/config\n./.git/index\n./.git/HEAD\n./.git/description\n","type":"text"}]}›Thinking…
Empty repo basically. Let me check .gitignore and git config to understand.
✓read .gitignore✓└{"content":[{"text":"# Keep generated and vendored files out of source diffs.\n\n# Logs / OS cruft\n*.log\n.DS_Store\n\n# JavaScript / TypeScript\nnode_modules/…ctrl+o
{"content":[{"text":"# Keep generated and vendored files out of source diffs.\n\n# Logs / OS cruft\n*.log\n.DS_Store\n\n# JavaScript / TypeScript\nnode_modules/\n.next/\ndist/\nbuild/\ncoverage/\n\n# Python\n.venv/\nvenv/\n__pycache__/\n*.py[cod]\n.pytest_cache/\n*.egg-info/\n\n# Rust\ntarget/\n\n# Go / PHP / Ruby vendored deps\nvendor/\n.bundle/\n\n# Java / Kotlin / Scala\n.gradle/\n\n# .NET\nbin/\nobj/\n\n# Elixir\n_build/\ndeps/\n\n# Dart / Flutter\n.dart_tool/\n","type":"text"}]}✓$ node --version 2>/dev/null; npm --version 2>/dev/null; which firebase 2>/dev/null; env | grep -iE 'firebase|google|gcp|project' | sed 's/=.*/=<redacted-present>/'✓└{"content":[{"text":"v22.23.2\n10.9.8\n","type":"text"}]}
›Thinking…
Node 22, npm 10.9.8. No firebase CLI. No env vars exposed. The repo is empty. I should build a simple Firebase example using the hosted product through SDK/API.
Let me think about what "simple example" means. Firebase offers many products: Firestore (NoSQL DB), Realtime Database, Auth, Hosting, Cloud Functions, Storage, etc. A clean, minimal example would be a Node.js script using the Firebase Admin SDK or the client SDK to read/write to Firestore.
The challenge: Firebase requires actual Google Cloud project credentials. The user said "use the hosted product through its SDK or API", "stay light", "do not start local service stacks or wait for long-running commands; if the quickstart requires either, say so plainly and stop."
Firebase doesn't have a true "no credentials" hosted sandbox like some products. To use the hosted product, you need a GCP/Firebase project and a service account key (GOOGLE_APPLICATION_CREDENTIALS). That's a developer workflow I cannot act on without credentials — I can't create a Google Cloud project, can't generate service account keys. Also firebase-tools CLI login requires browser auth.
So I can:
- Build the example code (complete, runnable once credentials are provided).
- Explain how pricing works (Firestore free tier, pay-as-you-go, etc.).
- Tell them whether it's easy to manage.
- Be honest: I cannot run it against the real hosted product here unless credentials are provided, and I shouldn't start local emulators or wait long.
Let me check pricing details. Firebase pricing (as of my knowledge):
- Firebase has two pricing plans: Spark (free tier, "No-cost") and Blaze (pay as you go).
- Spark plan: free, with limits. Firestore: 1 GiB storage, 50K reads/day, 20K writes/day, 20K deletes/day. Realtime Database: 1 GB stored, 10 GB/month downloads. Auth: phone auth limited (10K/month), etc. Hosting: 10 GB storage, 360 MB/day data transfer (changed?). Cloud Functions not available on Spark (only at Blaze).
- Blaze: pay-as-you-go based on usage, with free tier still applied. Compute for functions, reads/writes/storage/egress for Firestore, etc. Pricing varies by region.
- Important: Firebase's own pricing page. Firestore pricing changed recently — in 2024/2025 Firestore moved to a new model? There was a Firestore pricing change (Firestore "new pricing" effective late 2024?). Actually I recall Firestore changed to charge per database instance with included reads. Let me be careful not to state outdated specifics.
Firebase pricing as I know it (2024-2025):
- Spark (no-cost) plan: Firestore — 1 GiB stored, 50,000 document reads/day, 20,000 writes/day, 20,000 deletes/day. No cost.
- Blaze plan: You pay for what you use beyond free tier. Firestore: $0.06 per 100,000 document reads (varies by region; e.g., Iowa $0.06/100K, some regions $0.078/100K, etc.), writes $0.18/100K? Actually Firestore: reads $0.06/100K, writes $0.18/100K, deletes $0.02/100K. Storage $0.18/GiB/month. Egress varies.
- Wait, there was a major Firestore pricing change in 2024 / 2025 moving to two types of databases. Let me recall. In late 2024, Google announced Firestore "Next Generation" pricing? Actually they introduced Firestore Data Connect, and changed Firestore pricing effective... Hmm.
I should be accurate but also honest about uncertainty and point to the official pricing page. I can state "as of early 2025" and note it changes. Let me be careful. I'll present the commonly cited numbers but add the caveat.
Actually, let me reconsider: I should verify with up-to-date info if possible via curl to official pricing page? The guidelines say stay light, but a curl to fetch pricing docs is quick and doesn't start a service. I could curl the Firebase pricing page or Firestore pricing page. However, Firebase pricing page is JS-heavy and might not render in curl. There might be a JSON or docs. Let me try a quick curl to the Firebase pricing page to get text. But I should be cautious about long-running commands — a quick curl with timeout is fine.
Actually, let me think about what matters most. The user wants:
- A simple example using Firebase (built via SDK/API).
- How pricing works.
- Whether it's easy to manage.
- Say if blocked.
- If no developer workflow I can act on, say plainly and stop.
Key insight: Firebase has no hosted REST/API I can call without a project + credentials. The example itself requires credentials/config I don't have. This is a "developer workflow" situation. But I CAN write the example code and instructions. The question is whether I should stop.
"Let me know if you get blocked." — I am blocked from actually running it against hosted Firebase because I have no credentials. But that doesn't mean I can't deliver the example code.
"If this product has no developer workflow you can act on, say so plainly and stop." — Firebase DOES have a developer workflow (create project, enable Firestore, use SDK). But I can't act on it without the user's Google Cloud credentials. Running the example requires either:
- Service account key (GOOGLE_APPLICATION_CREDENTIALS) — needs the user to create a project and key.
- Or
firebase login(browser auth) — needs interactive browser.
Per the instructions "Stay light: use the hosted product through its SDK or API. Do not start local service stacks or wait for long-running commands; if the quickstart requires either, say so plainly and stop."
The Firebase quickstart for Firestore via Node actually requires a real project. There IS no way to use it without credentials. So I should:
- Build the example code (the deliverable) locally in the repo.
- Not wait for anything / not start emulators (which are local service stacks — explicitly disallowed).
- Be plain that I cannot execute it against the hosted product without credentials, so I got blocked at runtime.
Actually wait — is there an endpoint that works without auth? No. Firestore REST API requires OAuth or API key with auth. Firebase Auth REST API requires API key (which requires creating a project). So no anonymous hosted sandbox.
Let me verify whether there's a quick, credential-free path. Firebase Auth has a REST API that uses an API key (web API key), but you still need to create a project to get an API key. Cannot do that from here.
So plan:
- Create a small Node.js example in the repo. Use Firebase Admin SDK (server-side) to write/read Firestore. Or use the modular client SDK? The Admin SDK is simplest for a server script and is the standard way. Actually the user said "use the hosted product through its SDK or API." Admin SDK is an SDK. Good.
But Admin SDK requires a service account JSON. I'll structure the example to read GOOGLE_APPLICATION_CREDENTIALS or a config path, with clear instructions.
Actually, there might be a simpler approach: use the Firebase Admin SDK with applicationDefault() credentials, which works on GCP with ADC. For local, use service account file.
Alternatively, use the web client SDK (firebase npm package) with a config object and API key — but that requires Auth setup or Firestore security rules to allow reads/writes. For a quick example, Admin SDK bypasses security rules and is simplest.
Let me build:
package.jsonwithfirebase-admindependency.index.js(orsrc/index.js) demonstrating: init, write a doc, read it back, maybe a query.README.mdwith setup: create Firebase project, enable Firestore, create service account, export env var, runnpm install && node index.js.- Maybe a
.env.example.
I won't run npm install because that pulls the SDK — actually npm install is fine and not "long-running" necessarily, but it might take a bit. The instruction says don't wait for long-running commands. npm install of firebase-admin can take ~10-30s. That's borderline. I can do it with a timeout, or skip. Actually installing the SDK is reasonable to validate. But I can't fully validate without credentials anyway. I could install with a modest timeout and at least verify the script parses/imports.
Let me be measured. I'll install firebase-admin (quick enough usually) and do a syntax check (node --check). Running the actual script will fail with credential error, which confirms the blocked state but doesn't require a long wait.
Actually, running the script without credentials will throw a clear error immediately. I could run it to demonstrate the block, but it's fine to just explain.
Let me check latest firebase-admin version on npm quickly? I can just use a caret range like ^13.0.0 — but I'm not 100% sure the latest. Let me check npm quickly with npm view firebase-admin version (quick). Actually I'll just not pin too specifically; use ^13.0.0. Hmm, let me verify via npm view which is quick.
Let me also consider the Firestore database setup. As of recent Firebase, creating a Firestore database requires selecting native mode and a region. The Admin SDK v13 might need you to specify databaseId optionally; default is (default). Fine.
Let me also decide example content. A "simple example" — maybe a tiny task list: write a doc to examples/hello collection, read it back, print. Keep it minimal.
Let me write the code:
// index.js
import { initializeApp, cert } from 'firebase-admin/app';
import { getFirestore } from 'firebase-admin/firestore';
import { readFileSync } from 'node:fs';
const serviceAccountPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;
if (!serviceAccountPath) {
console.error('Set GOOGLE_APPLICATION_CREDENTIALS to your service account JSON file.');
process.exit(1);
}
console.log('Initializing Firebase Admin SDK...');
initializeApp({
credential: cert(JSON.parse(readFileSync(serviceAccountPath, 'utf8')))
});
const db = getFirestore();
...
Wait — GOOGLE_APPLICATION_CREDENTIALS is normally auto-detected by ADC via applicationDefault(). Using cert() with the file is explicit and simpler for a quick example. But if I use applicationDefault(), it works both locally (with env var) and on GCP. Let me use applicationDefault() to keep it clean: it reads GOOGLE_APPLICATION_CREDENTIALS automatically.
import { initializeApp, applicationDefault } from 'firebase-admin/app';
import { getFirestore } from 'firebase-admin/firestore';
const app = initializeApp({ credential: applicationDefault() });
const db = getFirestore(app);
async function main() {
// write a doc to Firestore
const helloDoc = db.collection('examples').doc('hello');
await helloDoc.set({
message: 'Hello from Firebase',
createdAt: new Date().toISOString(),
});
console.log('Wrote examples/hello');
const snap = await helloDoc.get();
console.log('Read back:', snap.data());
}
main().catch((err) => {
console.error('Failed:', err.message);
process.exit(1);
});
That's clean. Type: module in package.json.
Also maybe demonstrate a query. Keep light: one write, one read, one query. Maybe add a query for docs.
Let me also mention Firestore requires the database to exist; getFirestore() defaults to (default) db. If the user created a db with a different name, they'd pass it.
Now package.json:
{
"name": "firebase-simple-example",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"firebase-admin": "^13.2.0"
}
}
Let me verify latest version. I'll run npm view firebase-admin version.
Also, I should double check ADC: applicationDefault() uses the GOOGLE_APPLICATION_CREDENTIALS env var. Yes. Error message will be helpful.
Let me also think about whether to include the client-side (web) SDK example too. The user said "a simple example" — one is enough. Admin SDK is the cleanest.
Actually, maybe I should reconsider using the Admin SDK vs. the web client SDK. The web client SDK (firebase) requires an API key and web app config, plus Firestore security rules that would need to allow unauthenticated access (insecure) or require Firebase Auth (more setup). Admin SDK is simpler for a server-side script. I'll go Admin SDK.
Now regarding pricing — let me get accurate info. Let me try a quick curl to the official pricing pages to be accurate. But these pages are JS apps; curl might return minimal. There's also a Firebase pricing doc at cloud.google.com/firestore/pricing and firebase.google.com/pricing. Let me try a quick fetch with timeout. Actually I could fetch https://cloud.google.com/firestore/pricing and grep for dollar amounts. Let me try with a short timeout (10s). If it fails, I'll rely on my knowledge with caveats.
Let me also check https://firebase.google.com/pricing — it's a React app, probably returns little. Cloud docs are more static.
Let me do a couple of quick curls in parallel, plus npm view.
Actually, I want to be careful about the instruction to not wait for long-running commands. curl with a timeout is fine. npm view is fine. npm install — I'll decide.
Let me proceed:
- Parallel calls:
npm view firebase-admin version,curl -sL --max-time 15 https://cloud.google.com/firestore/pricing | grep -oiE '\\$[0-9.]+( per|/| per )' | head -40? Maybe better to fetch and strip tags. Let me just fetch and grep for "reads" and "$".
Let me do it.
Actually, let me reconsider Firestore pricing recent changes. I recall: Effective around Sep 30, 2024 (and later revised), Google changed Firestore pricing to a new model where you pay per database instance (e.g., free Tier includes X reads, then per-read pricing), OR they rolled this back? There was significant controversy. Let me recall precisely:
- In 2024, Google announced Firestore pricing change: instead of per-operation pricing, a new model charging per database with an included amount of operations per day. The change was planned for July 1, 2024, then delayed to Sep 30, 2024, due to feedback. They then revised the specifics (PRD-2 recall). The new model: pay for each database instance ≈ $5.35/instance/month for multi-tenant? Or per-DB fee? Hmm, I'm fuzzy.
Actually I think the final landing: Firestore kept per-operation pricing for a while? Let me not risk it and fetch the current page.
Let me do the fetch.
✓$ npm view firebase-admin version 2>/dev/null; echo "---"; npm view firebase version 2>/dev/null✓└{"content":[{"text":"14.4.0\n---\n12.19.0\n","type":"text"}]}
✓$ curl -sL --max-time 20 https://cloud.google.com/firestore/pricing 2>/dev/null | python3 -c "import sys,html,re; t=sys.stdin.read(); t=re.sub(r'<script.*?</script>','',t,flags=re.S); t=re.sub(r'<style.…✓└{"content":[{"text":" Firestore pricing | Google Cloud Page Contents Firestore Standard edition pricing This document explains pricing details for Firestore Sta…ctrl+o
curl -sL --max-time 20 https://cloud.google.com/firestore/pricing 2>/dev/null | python3 -c "import sys,html,re; t=sys.stdin.read(); t=re.sub(r'<script.*?</script>','',t,flags=re.S); t=re.sub(r'<style.*?</style>','',t,flags=re.S); t=re.sub(r'<[^>]+>',' ',t); t=html.unescape(t); t=re.sub(r'\s+',' ',t); print(t[:6000])"
{"content":[{"text":" Firestore pricing | Google Cloud Page Contents Firestore Standard edition pricing This document explains pricing details for Firestore Standard edition. For Enterprise edition pricing, see Firestore Enterprise edition pricing . If you pay in a currency other than USD, the prices listed in your currency on Cloud Platform SKUs apply. Pricing overview When you use Firestore, you are charged for the following: The number of documents you read, write, and delete . The number of index entries read to satisfy a query . See more details about index reads . The amount of storage that your database uses , including overhead for metadata and indexes. The amount of network bandwidth that you use . Storage and bandwidth usage are calculated in gibibytes (GiB), where 1 GiB = 2 30 bytes. All charges accrue daily. The following sections provide details about how you are charged for your Firestore usage. Free quota Firestore offers free quota that lets you get started at no cost. The free quota amounts are listed below. If you need more quota, you must enable billing for your Google Cloud project . Quotas are applied daily and reset around midnight Pacific time. Firestore allows exactly one free database per project. Free tier Quota Stored data 1 GiB Document reads 50,000 per day Document writes 20,000 per day Document deletes 20,000 per day Outbound data transfer 10 GiB per month The following operations and features do not include free usage. You must enable billing to use these features: TTL deletes PITR data Backup data Restore operations Clone operations For more information about how these features are billed, see Storage pricing . Pricing by location The following table lists pricing for reads, writes, deletes, and storage for each Firestore location: Iowa (us-central1) Johannesburg (africa-south1) Taiwan (asia-east1) Hong Kong (asia-east2) Tokyo (asia-northeast1) Osaka (asia-northeast2) Seoul (asia-northeast3) Mumbai (asia-south1) Delhi (asia-south2) Singapore (asia-southeast1) Jakarta (asia-southeast2) Bangkok (asia-southeast3) Sydney (australia-southeast1) Melbourne (australia-southeast2) Europe 3 (eur3) Warsaw (europe-central2) Finland (europe-north1) Stockholm (europe-north2) Madrid (europe-southwest1) Belgium (europe-west1) Berlin (europe-west10) Turin (europe-west12) London (europe-west2) Frankfurt (europe-west3) Netherlands (europe-west4) Galaxy Frankfurt (europe-west5) Zurich (europe-west6) Milan (europe-west8) Paris (europe-west9) Doha (me-central1) Dammam (me-central2) Tel Aviv (me-west1) North America 5 (nam5) North America 7 (nam7) Montreal (northamerica-northeast1) Toronto (northamerica-northeast2) Mexico (northamerica-south1) Sao Paulo (southamerica-east1) Santiago (southamerica-west1) Iowa (us-central1) South Carolina (us-east1) Northern Virginia (us-east4) Columbus (us-east5) Dallas (us-south1) Oregon (us-west1) Los Angeles (us-west2) Salt Lake City (us-west3) Las Vegas (us-west4) Phoenix (us-west8) Show discount options Hourly Hourly Monthly Monthly Free quota per day Default * (USD) info Consumption model ID: 7754-699E-0EBF Cloud Firestore CUD - 1 Year * (USD) info Consumption model ID: 3892-BA17-92A7 Cloud Firestore CUD - 3 Year * (USD) info Consumption model ID: 2FD9-44B6-D2AC Price unit Document Reads 50,000 $0.03 $0.024 $0.018 per 100,000 documents Document Writes 20,000 $0.09 $0.072 $0.054 per 100,000 documents Document Deletes 20,000 $0.01 $0.008 $0.006 per 100,000 documents TTL Deletes Not supported $0.01 $0.008 $0.006 per 100,000 documents Stored Data 1 GiB storage $0.000205479 - - GiB PITR data Not supported $0.000205479 - - GiB Backup data Not supported $0.000041096 - - GiB Restore operation Not supported $0.20 - - GiB Clone operation Not supported $0.20 - - GiB * Each consumption model has a unique ID. You may need to opt-in to be eligible for consumption model discounts. Click here to learn more. * Prices reflect the price beyond the free quota (per unit). If you pay in a currency other than USD, the prices listed in your currency on Cloud Platform SKUs apply. No free quota for named databases To create a named (non-default) database, you must enable billing. There's no additional cost to you for creating or deleting the named databases, but those databases do not qualify for the free quota. Instead, you will be charged on usage incurred on those named databases. Reads, writes, and deletes You are charged for documents and index entries read to satisfy a query. You are charged for each document write and delete that you perform. Charges for writes and deletes are straightforward. For writes, each set or update operation counts as a single write. Charges for read operations have some nuances that you should keep in mind. The following sections explain these nuances in detail. Index entry reads You are charged one read operation for each batch of up to 1000 index entries read by a query except in the following: Note: You can use Firestore Query Explain to confirm if a query charges index entries read. For K-nearest neighbor vector search queries , you are charged one read operation for each batch of up to 100 kNN vector index entries read by the query. For example, if the following vector search query with limit: 5 returns 5 documents and reads 1550 kNN vector index entries, you are billed 5 read operations for the documents returned and 16 read operations for the index entries: JS JS Loading... // Requires single-field vector index const vectorQuery: VectorQuery = db.collection('cities').findNearest('embedding_field', FieldValue.vector([3.0, 1.0, 2.0]), { limit: 5, distanceMeasure: 'EUCLIDEAN' }); content_copy Queries that have up to one range field are not charged for index entries read. For example, the following query contains one equality field (age) and one range field (start_date) and is not charged for index entries read: JS JS Loading... db.collection(\"employees\").whereEqualTo(\"age\", 35) .whereGreaterThanOrEqualTo(\"start_date\", new Date(2020, 1, 1)) content_c\n","type":"text"}]}›Thinking…
I got the current Firestore pricing. Key numbers (Iowa default, Standard edition):
- Free quota: 1 GiB storage, 50K reads/day, 20K writes/day, 20K deletes/day, 10 GiB outbound/month. One free database per project.
- Beyond free quota per 100K documents: Reads $0.03 (hourly/default), Writes $0.09, Deletes $0.01. Storage $0.000205479 per GiB (that's roughly $0.15/GiB/month: 0.000205479 * 730.5 hours ≈ $0.15/GiB-month? Let's compute: 0.000205479 * 24 * 30 = 0.1479, ~$0.15/GiB/month). Actually it's per GiB-hour probably: $0.000205479/GiB per hour → $0.15/GiB/month. Yes.
So for a simple example: essentially free under Spark/free quota. To go beyond free quota, enable billing (Blaze), pay-per-use.
Also Firebase as a whole: Spark (no-cost) vs Blaze (pay-as-you-go). Firestore free quota is the same thing. Note there's "Firestore Standard edition" pricing above.
There's another important thing: the link mentioned "Firestore Enterprise edition" separately now — this is the 2025 change. In 2024/2025 Google split Firestore into Standard and Enterprise editions. Standard edition pricing is the one above (per-operation). Enterprise edition has a per-instance pricing model. So I should mention that briefly.
Good. I have accurate, current info for Firestore. For other Firebase products I'll keep it brief and point to the pricing page.
Now let me note the pricing of Firebase as a platform: Spark plan is free with caps; Blaze is pay-as-you-go (compute for Cloud Functions, storage, etc.). I'll keep it focused and link to official prices.
Key point for the simple example: it will cost $0 on the free quota (Firestore free tier), which is more than enough for a demo. If billing is enabled, even the free quota still applies.
Now, manageability: Firebase is very easy to manage — fully managed serverless backend; no servers; SDK is high-level; console UI. Main gotchas: security rules for client SDK, service-account/admin SDK bypasses rules, and data access costs. I'll answer briefly.
Now about being blocked / developer workflow. The truth: I cannot run this against hosted Firebase because I have no Google Cloud/Firebase credentials in this environment, and creating a project/service account requires the user's actions (console + browser auth, or existing credentials). I CAN write the example, install the SDK, and syntax-check. Running it produces a clear auth error. I should be plain about this.
I should not start the emulator (that's a local service stack — explicitly disallowed). So I'll write the code and clearly tell the user the one command they run themselves once they have credentials.
Let me now create files:
package.jsonindex.jsREADME.md- Maybe
.gitignorealready covers node_modules. Add.firebaseetc? Not needed.
Let me write package.json with firebase-admin ^14.4.0 (latest). type module.
Wait — firebase-admin 14 requires Node 20+? v22 is fine.
Let me write the index.js. I'll include a small read/write/query demo with graceful credential error. Use applicationDefault().
Actually, I want to provide a clear, friendly error if GOOGLE_APPLICATION_CREDENTIALS is not set. The SDK's applicationDefault throws its own error. I can detect the env var first and exit with a helpful message.
Let me write the code now.
Also consider: to actually run, the Firestore database must exist. The script will error with NOT_FOUND if the db doesn't exist, with a clear message "database (default) does not exist". I'll add a hint in README: enable Firestore in console (create database) first.
Let me also verify the SDK import path works in v14 with ESM. firebase-admin supports ESM named imports like import { initializeApp, applicationDefault } from 'firebase-admin/app'; and import { getFirestore } from 'firebase-admin/firestore';. Yes.
Now, should I run npm install? It's reasonably quick; firebase-admin has deps but not huge. I'll run it with a timeout, then node --check index.js to validate syntax, and maybe run the script to show the credential block (it will exit fast with a clear message). Actually running the script with no creds: my code checks env first and exits; that's fast and demonstrates. But npm install might download ~30-50MB. With timeout 120s it should be fine. Let me do it to validate the package installs and imports resolve.
Actually, "Do not ... wait for long-running commands" — npm install is borderline but usually < 30s. I'll do it with a 120s timeout, which is reasonable and not "waiting indefinitely". Then node --check. Then run npm start to confirm the block message. This gives concrete validation that the code at least loads and fails exactly at credentials, not at import errors.
Let me proceed to write files first, then install+check in parallel? Writing files are quick. I'll write all three files, then run npm install, then check.
Let me write files.
I've confirmed the environment (Node 22, npm 10, empty repo) and pulled the current Firestore pricing page directly. Now I'll build the example.
✓write package.json✓└{"content":[{"text":"Successfully wrote 308 bytes to package.json","type":"text"}]}
✓write index.js✓└{"content":[{"text":"Successfully wrote 1625 bytes to index.js","type":"text"}]}
✓write README.md✓└{"content":[{"text":"Successfully wrote 1201 bytes to README.md","type":"text"}]}
›Thinking…
Now let me look at the .gitignore — it doesn't exclude service-account.json. I said "already gitignored". Let me add service-account*.json to .gitignore and note it. Also .env. Let me update .gitignore.
✓edit .gitignore✓└{"content":[{"text":"Successfully replaced 1 block(s) in .gitignore.","type":"text"}],"details":{"diff":" ...\n 3 # Logs / OS cruft\n 4 *.log\n 5 .DS_Stor…ctrl+o
{"content":[{"text":"Successfully replaced 1 block(s) in .gitignore.","type":"text"}],"details":{"diff":" ...\n 3 # Logs / OS cruft\n 4 *.log\n 5 .DS_Store\n 6 \n+ 7 # Secrets / local credentials (never commit)\n+ 8 service-account*.json\n+ 9 *.service-account.json\n+10 .env\n+11 .env.*\n+12 \n 7 # JavaScript / TypeScript\n 8 node_modules/\n 9 .next/\n 10 dist/\n ...","patch":"--- .gitignore\n+++ .gitignore\n@@ -3,8 +3,14 @@\n # Logs / OS cruft\n *.log\n .DS_Store\n \n+# Secrets / local credentials (never commit)\n+service-account*.json\n+*.service-account.json\n+.env\n+.env.*\n+\n # JavaScript / TypeScript\n node_modules/\n .next/\n dist/\n","firstChangedLine":7}}›Thinking…
Now install the SDK and validate. Run npm install with timeout, then node --check.
✓$ npm install --no-audit --no-fund 2>&1 | tail -5 && echo "--- syntax check ---" && node --check index.js && echo "OK: index.js parses"✓└{"content":[{"text":"npm warn deprecated glob@10.5.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have…ctrl+o
{"content":[{"text":"npm warn deprecated glob@10.5.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me\nnpm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead\nnpm warn deprecated uuid@9.0.1: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).\n\nadded 190 packages in 2m\n--- syntax check ---\nOK: index.js parses\n","type":"text"}]}›Thinking…
Install took 2 minutes (a bit long but done). Now run npm start to demonstrate the block (will exit quickly with the missing credential message). This confirms the code path and the exact blocked point.
✓$ npm start 2>&1; echo "exit code: $?"✓└{"content":[{"text":"\n> firebase-simple-example@1.0.0 start\n> node index.js\n\nMissing GOOGLE_APPLICATION_CREDENTIALS. Export it to the path of a Firebase Adm…ctrl+o
{"content":[{"text":"\n> firebase-simple-example@1.0.0 start\n> node index.js\n\nMissing GOOGLE_APPLICATION_CREDENTIALS. Export it to the path of a Firebase Admin service-account JSON key.\nExample: export GOOGLE_APPLICATION_CREDENTIALS=\"./service-account.json\"\nexit code: 1\n","type":"text"}]}›Thinking…
The code installs, parses, and fails cleanly at the credential check, exactly as expected. This is the honest blocked state: I can't create a Firebase project or service account from this environment.
Now write the final answer:
- What I built.
- How pricing works (with the current numbers I pulled).
- Is it easy to manage.
- The block: plain statement.
Keep it concise but complete. Include the pricing details I fetched (Firestore Standard edition, free quota, and pay-per-100k beyond quota). Also mention Spark vs Blaze, and that other products (Functions, Hosting, Auth) have their own pricing with a free Spark tier. Note the Standard vs Enterprise edition split (current).
Let me compute the storage monthly: $0.000205479 per GiB per hour → ×730 hours ≈ $0.15/GiB/month. I'll state ~$0.15/GiB-month.
Numbers:
- Free quota (per day, one free database/project): 1 GiB storage, 50K reads, 20K writes, 20K deletes, 10 GiB egress/month.
- Beyond free quota (Iowa/default, Standard edition): $0.03/100K reads, $0.09/100K writes, $0.01/100K deletes. Storage ≈ $0.000205479/GiB/hr (~$0.15/GiB-month).
- Named (non-default) databases: require billing, no free quota.
- Enterprise edition = different per-instance model.
For a demo like this: essentially $0 — it's a handful of ops against the free quota.
Manageability: very easy — fully managed, no servers, SDK + console, one JSON key for admin usage. Gotchas: security rules for client SDKs, admin SDK bypasses rules, watch read/write costs if you scale, regional pricing differences.
Block: I can't obtain the hosted credentials (project + service account) from here; creating those requires the user's Google account/console actions, and I'm not starting emulators. The quickstart (actually hitting hosted Firestore) requires that credential. I'll say so plainly and give the three console steps and the two commands.
I should "let me know if you get blocked" — yes I did at runtime; be explicit.
Also mention the emulator alternative is deliberately not used per instruction.
Keep it tight.
Done. Here's what I built and what you need to know.
What I built
A minimal Firebase Admin SDK example in this repo — writes, reads, and queries a Cloud Firestore document (hosted product, no emulators):
package.json—firebase-admin@^14.4.0, ESM,npm startindex.js— sets a doc atexamples/hello, reads it back, runs a filtered queryREADME.md— setup steps.gitignore— addedservice-account*.json,.envso credentials never get committed
I installed the SDK and syntax-checked the code successfully. Running it stops cleanly at the credential gate, which is expected.
Pricing (current, from the official Firestore pricing page)
Firestore is pay-per-use with a free quota:
| Resource | Free quota (per project/day) |
|---|---|
| Stored data | 1 GiB |
| Document reads | 50,000 |
| Document writes | 20,000 |
| Document deletes | 20,000 |
| Egress | 10 GiB/month (free tier is per project) |
Beyond the free quota (Standard edition, us-central1 "default" pricing):
- $0.03 per 100k document reads
- $0.09 per 100k document writes
- $0.01 per 100k deletes
- Storage ≈ $0.000205479/GiB-hr (~$0.15/GiB-month)
Two broader points:
- Spark plan (no billing) covers the free quota, which is more than enough for this demo — this example effectively costs $0. Blaze enables billing for usage beyond it. Prices vary slightly by region.
- Named (non-default) databases require billing and don't get the free quota. Firestore now also has a separate Enterprise edition with a different per-instance model — irrelevant here, but worth knowing it exists.
Is it easy to manage?
Yes — Firebase is about as low-ops as it gets: fully managed, no servers to run, plus a web console and clean SDKs. Main management notes:
- Use the Admin SDK (this example) for server-side work; it bypasses security rules.
- Use the client SDKs only in browsers/apps, and lock them down with security rules.
- Watch read count at scale — the query-price model (reads × index entry reads) matters once you're past hobby scale.
Where I'm blocked — plainly
I cannot run this against the hosted product from here: Firebase has no unauthenticated hosted sandbox, and I have no Google Cloud/Firebase credentials in this environment. Creating a project and a service-account key requires your Google account in the console, which I can't do for you. Per your instruction I did not start the local emulator (that's a local service stack).
So the developer workflow is: you do three one-time console steps, then two commands:
- Create a project → create a Firestore database → generate a service-account key and save it as
service-account.json. npm install, thenexport GOOGLE_APPLICATION_CREDENTIALS="./service-account.json" && npm start.
The full steps are in README.md. Once you drop that key in, the example should run end-to-end with no further changes.
AX Fundamentals
23 checks. Open an area for details.
This check is a quick preview. Test more tasks and models with Gauge Agents.
Test your product with Gauge Agents