# Supabase alternative for firebase auth proxy edge

> Documents composed Firebase and Supabase pipeline clone path. For "supabase alternative for firebase auth proxy edge", store FIREBASE_ACCESS_TOKEN, SUPABASE_SERVICE_ROLE_KEY in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let FlutterFlow hit only https://realcomposer.com/v1/workspace/firebase-auth-supabase-profile-edge-tutorial with an rc_live_ client token.

- Canonical page: https://realcomposer.com/recipes/firebase-auth-supabase-profile-edge-tutorial
- Client platform: FlutterFlow
- Upstream services: Firebase, Supabase
- Category: Platforms & Frameworks
- JSON version: https://realcomposer.com/recipes/firebase-auth-supabase-profile-edge-tutorial.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=firebase-auth-supabase-profile-edge-tutorial&via=agent

## Problem: FlutterFlow cannot attach secret headers to Firebase and Supabase

FlutterFlow runs in the browser or a sandbox without a secret store. Firebase and Supabase rejects unsigned browser origins or requires server-only headers.

- Proxy hacks that break when vendors tighten CSP
- Zapier-only workarounds adding cost and latency
- Guest users seeing failed network requests in demos

## Solution steps

1. **Bind vault keys to the Worker**: Store FIREBASE_ACCESS_TOKEN, SUPABASE_SERVICE_ROLE_KEY in the vault. FlutterFlow never embeds the raw secret, only a revocable rc_live_ client token.

2. **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 Add output mapping fields that mirror the JSON contract your screen already expects.

3. **Wire the FlutterFlow API Call**: Call https://realcomposer.com/v1/workspace/firebase-auth-supabase-profile-edge-tutorial with a restricted rc_live_ client token. FlutterFlow never sends upstream secrets.

```
// FlutterFlow API Call
URL: https://realcomposer.com/v1/workspace/firebase-auth-supabase-profile-edge-tutorial
Header Authorization: Bearer rc_live_your_token
```

## Pipeline config

Import this config into a RealComposer pipeline. `{{secrets.NAME}}` values are read from the encrypted Secret Vault at request time, so the client never sees them.

```json
{
  "name": "Supabase alternative for firebase auth proxy edge",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "firebase",
      "upstreamUrlTemplate": "https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}}",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.FIREBASE_ACCESS_TOKEN}}"
      },
      "timeoutMs": 3000
    },
    {
      "stepKey": "supabase",
      "upstreamUrlTemplate": "https://{{secrets.SUPABASE_PROJECT_REF}}.supabase.co/rest/v1/{{query.table}}?{{query.filter}}",
      "httpMethod": "GET",
      "headersTemplate": {
        "apikey": "{{secrets.SUPABASE_SERVICE_ROLE_KEY}}",
        "Authorization": "Bearer {{secrets.SUPABASE_SERVICE_ROLE_KEY}}"
      },
      "timeoutMs": 3000
    }
  ],
  "outputMapping": {
    "version": 1,
    "fields": [
      {
        "targetPath": "firebase.docName",
        "sourcePath": "name",
        "type": "string",
        "sourceStep": "firebase"
      },
      {
        "targetPath": "firebase.fields",
        "sourcePath": "fields",
        "type": "object",
        "sourceStep": "firebase"
      },
      {
        "targetPath": "supabase.rowId",
        "sourcePath": "0.id",
        "type": "string",
        "sourceStep": "supabase"
      },
      {
        "targetPath": "supabase.email",
        "sourcePath": "0.email",
        "type": "string",
        "sourceStep": "supabase"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/firebase-auth-supabase-profile-edge-tutorial" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_firebase",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "firebase-auth-supabase-profile-edge-tutorial"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "firebase_docName": "sample",
  "firebase_fields": "sample",
  "supabase_rowId": "sample",
  "supabase_email": "sample"
}
```

## FAQ

### Is it safe to log Firebase responses in FlutterFlow?

Point FlutterFlow at /recipes/firebase-auth-supabase-profile-edge-tutorial edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.

### Will Anthropic or Linear prompt bodies be rewritten?

firebase-auth-supabase-profile-edge-tutorial keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache.

### How do I rotate upstream credentials?

Rotate vault secrets for firebase-auth-supabase-profile-edge-tutorial anytime; clients keep the same rc_live_ token.
