Call Plaid API from Flutter without Exposing Client Secret
Plaid secrets stay out of Frontend / Web bundles
Frontend / Web cannot safely store Plaid production keys. Vault-bound headers reach https://production.plaid.com/accounts/get on Workers while apps call your plaid-api-proxy-flutter edge URL.
Why Frontend / Web leaks Plaid credentials
Attackers routinely extract Plaid secrets from Frontend / Web builds. Direct browser calls also expose internal error payloads with hostnames.
- Production Plaid keys copied from Frontend / Web bundles
- Compliance violations after credential leaks
- Attackers replaying vault-grade scopes from a laptop
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Add PLAID_SECRET to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Set headers, mapping, and cache TTL
Use POST against https://production.plaid.com/accounts/get. Allowed origins on the client token should match post pipelines set cache ttl to 0 because realcomposer only stores get responses at the edge. Plaid /accounts/get expects client_id and secret inside the JSON body your app POSTs. Header injection alone cannot authenticate Plaid.
Call from Frontend / Web
Call https://realcomposer.com/v1/workspace/plaid-api-proxy-flutter with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.
const res = await fetch('https://realcomposer.com/v1/workspace/plaid-api-proxy-flutter', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_plaid-ap",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "plaid-api-proxy-flutter"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"accountId": "sample",
"name": "sample",
"type": "sample"
}
Recipe Specs
- HTTP method
- POST
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 3
- Payload
- 242 B to 54 B (-78%)
curl -X POST "https://realcomposer.com/v1/workspace/plaid-api-proxy-flutter" \
-H "Authorization: Bearer rc_live_client_token" \
-H "Content-Type: application/json" \
-d '{"model":"example"}'Developer Questions & Troubleshooting
What should Frontend / Web store instead of Plaid secrets?
Use scoped tokens where the vendor allows them on plaid-api-proxy-flutter. Admin keys stay {{secrets.*}} references only.
How do I forward JSON bodies to POST upstreams?
Cache key for plaid-api-proxy-flutter: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.
What happens if an upstream step times out?
Rotate vault secrets for plaid-api-proxy-flutter anytime; clients keep the same rc_live_ token.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + Plaid Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.