Overview
Firebase has two databases with different REST APIs and different hosts, so this package ships two connectors that you can deploy together or on their own:FirebaseRealtimeDatabaseRestApitalks to the Realtime Database REST API onhttps://<database>.firebaseio.com. Any path plus.jsonis an endpoint, and plain JSON goes in and out.CloudFirestoreRestApitalks to the Cloud Firestore REST API onhttps://firestore.googleapis.com. Documents use Firestore typed values.
Realtime Database events
Topics use
data/firebase/rtdb/<object>/<verb>.
Cloud Firestore events
Topics use
data/firebase/firestore/<object>/<verb>. Replies for both connectors arrive on <topic>/response.
Auth
Both connectors sendAuthorization: Bearer {value.json.access_token}. Mint the token outside the connector (a Python action, edge service, or SDK) and keep the service account key or token in Hub secrets, for example FIREBASE_ACCESS_TOKEN. Never commit keys.
- Realtime Database: a Google OAuth2 access token from a service account with scopes
https://www.googleapis.com/auth/userinfo.emailandhttps://www.googleapis.com/auth/firebase.database. The API also accepts the token as?access_token=, and a Firebase Auth ID token as?auth=<ID_TOKEN>; edit the endpoints if you use those. See Authenticate REST requests. - Cloud Firestore: a Google OAuth2 access token for a service account with a Datastore role such as
roles/datastore.user(scopehttps://www.googleapis.com/auth/datastoreorcloud-platform). Service account tokens bypass security rules. A Firebase Auth ID token also works and is checked against your rules.
Basic Syntax
Realtime Database
Cloud Firestore
BASE_ADDRESS on the Realtime Database connector to your instance URL: https://<database>-default-rtdb.firebaseio.com for US instances, or https://<database>-default-rtdb.<region>.firebasedatabase.app elsewhere. The Firestore connector targets the (default) database; edit the endpoints for a named database.
Payload examples
Realtime Database
Set device state, with a server-side timestamp, ondata/firebase/rtdb/state/set:
data/firebase/rtdb/event/append:
data/firebase/rtdb/fields/update:
ts on data/firebase/rtdb/path/query (order_by is URL-encoded and quoted, here "ts"):
".indexOn": ["ts"]; ordering by %22%24key%22 ("$key") needs none.
Cloud Firestore
Upsert a device document ondata/firebase/firestore/document/upsert:
data/firebase/firestore/document/merge:
data/firebase/firestore/document/create:
data/firebase/firestore/documents/query:
"integerValue": "42"), and timestamps are RFC 3339 (timestampValue).
Errors and limits
- Realtime Database:
401 {"error":"Permission denied"}means a missing or bad token or a rules denial.404 {"error":"404 Not Found"}usually means theBASE_ADDRESSinstance URL is wrong. Addprint=silentto write endpoints to get204 No Contentinstead of the echoed data. - Cloud Firestore:
401 UNAUTHENTICATED(bad or expired token),403 PERMISSION_DENIED(missing role, rules, or API not enabled on the project),404 NOT_FOUND,400 INVALID_ARGUMENT(bad typed value or mask).MergeFieldsneeds a non-emptyupdate_mask; send an upsert instead if you want to replace the whole document. - Firestore writes to a single document are limited to about one per second sustained; spread high-rate telemetry across documents or use the Realtime Database.
- Realtime Database streaming (Server-Sent Events) is not covered by these client connectors.
Testing
Tested on 2026-10-05 (PT):- Firebase Local Emulator Suite (firebase-tools, Realtime Database and Firestore emulators): all 11 connector events returned
200with the exact methods, endpoints, headers and bodies the connectors send, and requests without a token were rejected by security rules (401and403). - Real Realtime Database:
GETon a public Firebase instance returned200for path reads andorderBy/limitToFirstqueries;PUT,POSTandPATCHwithout credentials returned401 Permission denied. - Real Firestore: requests reached
firestore.googleapis.comand returned401 UNAUTHENTICATEDfor an invalid token.

