Firebase
Read Firebase Authentication users and Firestore documents, for example while you move a Firebase app to VAIF Studio.
Connect it in the console under Integrations > Connectors. See Connectors for how connectors work and who can use them.
Create a read-only credential
Section titled “Create a read-only credential”Create a service account in the Google Cloud console with the roles Firebase Authentication Viewer and Cloud Datastore Viewer, and create a JSON key for it. The key from Project settings > Service accounts > Generate new private key also works, but it can do much more than read.
Settings
Section titled “Settings”| Setting | Notes | |
|---|---|---|
| Firebase project ID | Required | For example my-firebase-project. |
| Service account key (JSON) | Required | From Project settings > Service accounts > Generate new private key. Stored encrypted and never shown again. |
Tables
Section titled “Tables”| Table | Filters | Returns |
|---|---|---|
auth_users | page_token | Firebase Authentication users. |
firestore_collections | None | Top-level Firestore collections. |
firestore_documents | collection (required), page_token | Documents in one collection, fields flattened to JSON. |
Query from the API
Section titled “Query from the API”curl -s -X POST "https://api.vaif.studio/database/connector/$VAIF_PROJECT_ID/query" \ -H "Authorization: Bearer $VAIF_TOKEN" -H "Content-Type: application/json" \ -d '{"wrapperId":"firebase_fdw","table":"firestore_documents","filters":{"collection":"users"},"limit":50}'$VAIF_TOKEN is a console access token. See Connectors for the routes.
How it stays read-only
Section titled “How it stays read-only”Use a key whose roles can only read. Firestore fields come back converted to JSON.