Imported from zuplo/zuplo (
examples/proxy-firestore-admin/AGENTS.md). Install upstream withnpx skills add zuplo/zuplo --skill proxy-firestore-admin. Copyright stays with the author.
Proxy Firestore Admin
This sample demonstrates how to expose Firestore documents through a REST API using the Zuplo URL Rewrite Handler and the Firebase Admin Auth Policy.
Key Files
| File | Purpose |
|---|---|
config/routes.oas.json |
Route definitions with policies |
config/policies.json |
Policy configurations |
Routes
| Method | Path | Description |
|---|---|---|
| GET | /doc/{id} |
Proxy Firebase Document |
Getting Started
Create a local copy:
npx create-zuplo-api@latest --example proxy-firestore-admin
Run locally:
npm install
npm run dev
# Server runs on https://localhost:9000
Deploy to Zuplo:
zuplo deploy
Or use the Deploy to Zuplo button.
Test Commands
# Proxy Firebase Document
curl http://localhost:9000/doc/{id}
Policies Used
- upstream-firebase-admin (Built-in): upstream-firebase-admin-auth-inbound
Environment Variables
SERVICE_ACCOUNT_JSON- The Firebase Service Account tokenFIREBASE_PROJECT- The Firebase project ID
