{
  "slug": "plaid-api-proxy-flutter",
  "title": "Call Plaid API from Flutter without Exposing Client Secret",
  "metaTitle": "Call Plaid API from Flutter without - RealComposer",
  "metaDescription": "Call plaid api from flutter without exposing client secret. Keep Plaid keys in RealComposer Vault; Frontend / Web uses rc_live_ tokens only.",
  "headline": "Plaid secrets stay out of Frontend / Web bundles",
  "category": "security",
  "categoryLabel": "Security & Secret Vault",
  "urgency": 10,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Plaid"
  ],
  "searchIntentQuery": "call plaid api from flutter without exposing client secret",
  "directAnswerSummary": "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.",
  "problem": {
    "title": "Why Frontend / Web leaks Plaid credentials",
    "explanation": "Attackers routinely extract Plaid secrets from Frontend / Web builds. Direct browser calls also expose internal error payloads with hostnames.",
    "risks": [
      "Production Plaid keys copied from Frontend / Web bundles",
      "Compliance violations after credential leaks",
      "Attackers replaying vault-grade scopes from a laptop"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Add PLAID_SECRET to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "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."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Call https://realcomposer.com/v1/workspace/plaid-api-proxy-flutter with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/plaid-api-proxy-flutter', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Call Plaid API from Flutter without Exposing Client Secret",
    "method": "POST",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "plaid",
        "upstreamUrlTemplate": "https://production.plaid.com/accounts/get",
        "httpMethod": "POST",
        "headersTemplate": {
          "Content-Type": "application/json"
        },
        "timeoutMs": 10000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "accountId",
          "sourcePath": "accounts.0.account_id",
          "type": "string",
          "sourceStep": "plaid"
        },
        {
          "targetPath": "name",
          "sourcePath": "accounts.0.name",
          "type": "string",
          "sourceStep": "plaid"
        },
        {
          "targetPath": "type",
          "sourcePath": "accounts.0.type",
          "type": "string",
          "sourceStep": "plaid"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "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"
      }
    }
  },
  "sampleSlimmedOutput": {
    "accountId": "sample",
    "name": "sample",
    "type": "sample"
  },
  "curlSnippet": "curl -X POST \"https://realcomposer.com/v1/workspace/plaid-api-proxy-flutter\" \\\n  -H \"Authorization: Bearer rc_live_client_token\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"example\"}'",
  "faqs": [
    {
      "question": "What should Frontend / Web store instead of Plaid secrets?",
      "answer": "Use scoped tokens where the vendor allows them on plaid-api-proxy-flutter. Admin keys stay {{secrets.*}} references only."
    },
    {
      "question": "How do I forward JSON bodies to POST upstreams?",
      "answer": "Cache key for plaid-api-proxy-flutter: internal edge-cache path plus sorted query. Identical params hit; vary userId per user."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Rotate vault secrets for plaid-api-proxy-flutter anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "cache-third-party-api-at-edge",
    "strip-sensitive-fields-user-profile-api",
    "slim-github-api-response-mobile-widgets"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/plaid-api-proxy-flutter",
    "markdown": "https://realcomposer.com/recipes/plaid-api-proxy-flutter.md",
    "json": "https://realcomposer.com/recipes/plaid-api-proxy-flutter.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=plaid-api-proxy-flutter&via=agent"
  }
}