Firebase user profile api strip sensitive fields
Public profiles without provider tokens
Remove refresh tokens providerData internals at edge. For "firebase user profile api strip sensitive fields", store FIREBASE_ACCESS_TOKEN in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/strip-firebase-user-profile-sensitive with an rc_live_ client token.
Firebase JSON bloat on React Native
Oversized Firebase payloads inflate parse time and mobile data charges for React Native users.
- Main-thread JSON parse stalls on low-end phones
- Accidentally exposing PII fields to the client
- Downstream components re-render on unused keys
How RealComposer Solves This at the Edge
Store upstream credentials in Secret Vault
Create FIREBASE_ACCESS_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.
Target the real upstream URL
Configure headersTemplate to inject vault secrets, target https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}}, and Map only the UI fields in output mapping so clients never download audit or nested blobs.
Call from React Native
Allowed origins on the token should list every React Native host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/strip-firebase-user-profile-sensitive', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_strip-fi",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "strip-firebase-user-profile-sensitive"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"docName": "sample",
"fields": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 2
- Payload
- 256 B to 38 B (-85%)
curl -X GET "https://realcomposer.com/v1/workspace/strip-firebase-user-profile-sensitive" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Can React Native call Firebase without holding the production key?
Point React Native at /recipes/strip-firebase-user-profile-sensitive edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.
Does POST traffic get cached?
strip-firebase-user-profile-sensitive keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache.
Can I restrict which domains call this pipeline?
Upstream steps in strip-firebase-user-profile-sensitive honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this React Native + Firebase Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.