← knowledge.oriz.in

firebase-rest-firestore (NOT firebase-admin) for Workers compatibility

decision firebasecloudflareworkersdependencyfirestore

firebase-rest-firestore (NOT firebase-admin) for Workers compatibility

Decision

Server-side Firestore access from the umbrella Hono Worker uses firebase-rest-firestore (REST + service-account JWT). The firebase-admin SDK is excluded — it requires gRPC, which Cloudflare's workerd runtime only partially supports, and which inflates Worker bundle size past comfortable limits.

Why

The umbrella Hono Worker at api.oriz.in runs on Cloudflare Workers free, which uses workerd. workerd supports fetch-based REST calls perfectly but breaks on firebase-admin's gRPC code paths under load. firebase-rest-firestore is a thin REST wrapper that handles service-account JWT signing and document I/O via plain fetch — exactly what Workers want.

Implications

Cross-refs