# Flutterflow Call Multiple Apis on Page Load

> FlutterFlow browsers cannot call https://jsonplaceholder.typicode.com/users/{{query.userId}} directly because of CORS and hidden credentials. RealComposer responds to OPTIONS and proxies authorized traffic.

- Canonical page: https://realcomposer.com/recipes/flutterflow-multiple-apis-page-load
- Client platform: FlutterFlow
- Upstream services: REST API
- Category: Platforms & Frameworks
- JSON version: https://realcomposer.com/recipes/flutterflow-multiple-apis-page-load.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=flutterflow-multiple-apis-page-load&via=agent

## Problem: FlutterFlow cannot attach secret headers to REST API

FlutterFlow runs in the browser or a sandbox without a secret store. REST API 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**: Create API_BEARER_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2. **Target the real upstream URL**: Use GET against https://jsonplaceholder.typicode.com/users/{{query.userId}}. Allowed origins on the client token should match leave cache ttl at 0 when each response is user-specific (include userid or record id in query params before enabling cache).

3. **Wire the FlutterFlow API Call**: Call https://realcomposer.com/v1/workspace/flutterflow-multiple-apis-page-load with a restricted rc_live_ client token. FlutterFlow never sends upstream secrets.

```
// FlutterFlow API Call
URL: https://realcomposer.com/v1/workspace/flutterflow-multiple-apis-page-load
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": "Flutterflow Call Multiple Apis on Page Load",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "upstream",
      "upstreamUrlTemplate": "https://jsonplaceholder.typicode.com/users/{{query.userId}}",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.API_BEARER_TOKEN}}"
      },
      "timeoutMs": 3000
    }
  ],
  "outputMapping": {
    "version": 1,
    "fields": [
      {
        "targetPath": "userId",
        "sourcePath": "id",
        "type": "number",
        "sourceStep": "upstream"
      },
      {
        "targetPath": "name",
        "sourcePath": "name",
        "type": "string",
        "sourceStep": "upstream"
      },
      {
        "targetPath": "email",
        "sourcePath": "email",
        "type": "string",
        "sourceStep": "upstream"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/flutterflow-multiple-apis-page-load" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_flutterf",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "flutterflow-multiple-apis-page-load"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "userId": "sample",
  "name": "sample",
  "email": "sample"
}
```

## FAQ

### Does FlutterFlow need CORS changes after adding RealComposer?

Use scoped tokens where the vendor allows them on flutterflow-multiple-apis-page-load. Admin keys stay {{secrets.*}} references only.

### When does edge caching apply to this recipe?

flutterflow-multiple-apis-page-load forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.

### How do I rotate upstream credentials?

Rotate vault secrets for flutterflow-multiple-apis-page-load anytime; clients keep the same rc_live_ token.
