# Fix cors error mailchimp api call flutterflow

> Same pattern as Stripe FlutterFlow: edge URL bypasses CORS. For "fix cors error mailchimp api call flutterflow", store MAILCHIMP_BASIC_AUTH in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let FlutterFlow hit only https://realcomposer.com/v1/workspace/fix-cors-error-mailchimp-flutterflow with an rc_live_ client token.

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

## Problem: FlutterFlow cannot attach secret headers to Mailchimp

FlutterFlow runs in the browser or a sandbox without a secret store. Mailchimp 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. **Store upstream credentials in Secret Vault**: Store MAILCHIMP_BASIC_AUTH in the vault. FlutterFlow never embeds the raw secret, only a revocable rc_live_ client token.

2. **Set headers, mapping, and cache TTL**: Configure headersTemplate to inject vault secrets, target https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10, and Add output mapping fields that mirror the JSON contract your screen already expects.

3. **Wire the FlutterFlow API Call**: Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.

```
// FlutterFlow API Call
URL: https://realcomposer.com/v1/workspace/fix-cors-error-mailchimp-flutterflow
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": "Fix cors error mailchimp api call flutterflow",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "mailchimp",
      "upstreamUrlTemplate": "https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Basic {{secrets.MAILCHIMP_BASIC_AUTH}}"
      },
      "timeoutMs": 3000
    }
  ],
  "outputMapping": {
    "version": 1,
    "fields": [
      {
        "targetPath": "memberId",
        "sourcePath": "members.0.id",
        "type": "string",
        "sourceStep": "mailchimp"
      },
      {
        "targetPath": "email",
        "sourcePath": "members.0.email_address",
        "type": "string",
        "sourceStep": "mailchimp"
      },
      {
        "targetPath": "status",
        "sourcePath": "members.0.status",
        "type": "string",
        "sourceStep": "mailchimp"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/fix-cors-error-mailchimp-flutterflow" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_fix-cors",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "fix-cors-error-mailchimp-flutterflow"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "memberId": "sample",
  "email": "sample",
  "status": "sample"
}
```

## FAQ

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

Point FlutterFlow at /recipes/fix-cors-error-mailchimp-flutterflow edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.

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

fix-cors-error-mailchimp-flutterflow keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache.

### What happens if an upstream step times out?

Allowed origins on the fix-cors-error-mailchimp-flutterflow client token restrict which domains may call the edge URL.
