{
  "slug": "contentful-cma-proxy-retool",
  "title": "Contentful management api secure proxy retool",
  "metaDescription": "Contentful management api secure proxy retool. Contentful CMA writes from Retool via edge with scoped. Keep Contentful keys in RealComposer Vault;.",
  "headline": "Retool CMS consoles with CMA keys off-browser",
  "category": "security",
  "categoryLabel": "Security & Secret Vault",
  "urgency": 8,
  "clientPlatform": "Retool",
  "upstreamServices": [
    "Contentful"
  ],
  "searchIntentQuery": "contentful management api secure proxy retool",
  "directAnswerSummary": "Contentful CMA writes from Retool via edge with scoped tokens. For \"contentful management api secure proxy retool\", store CONTENTFUL_MANAGEMENT_TOKEN in Secret Vault, call https://api.contentful.com/spaces/{{query.spaceId}}/entries from a Worker, and let Retool hit only https://realcomposer.com/v1/workspace/contentful-cma-proxy-retool with an rc_live_ client token.",
  "problem": {
    "title": "Why Retool leaks Contentful credentials",
    "explanation": "Attackers routinely extract Contentful secrets from Retool builds. Direct browser calls also expose internal error payloads with hostnames.",
    "risks": [
      "Production Contentful keys copied from Retool bundles",
      "Compliance violations after credential leaks",
      "Attackers replaying vault-grade scopes from a laptop"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Add CONTENTFUL_MANAGEMENT_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Configure upstream steps and output mapping",
      "description": "Use GET against https://api.contentful.com/spaces/{{query.spaceId}}/entries. 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)."
    },
    {
      "stepNumber": 3,
      "title": "Query from Retool",
      "description": "Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.",
      "codeSnippet": "// REST resource or JS query\nconst rows = await fetch('https://realcomposer.com/v1/workspace/contentful-cma-proxy-retool', {\n  headers: { Authorization: 'Bearer rc_live_token' }\n}).then(r => r.json());"
    }
  ],
  "pipelineConfig": {
    "name": "Contentful management api secure proxy retool",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "contentful",
        "upstreamUrlTemplate": "https://api.contentful.com/spaces/{{query.spaceId}}/entries",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.CONTENTFUL_MANAGEMENT_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "entryId",
          "sourcePath": "items.0.sys.id",
          "type": "string",
          "sourceStep": "contentful"
        },
        {
          "targetPath": "title",
          "sourcePath": "items.0.fields.title",
          "type": "string",
          "sourceStep": "contentful"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_contentf",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "contentful-cma-proxy-retool"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "entryId": "sample",
    "title": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/contentful-cma-proxy-retool\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Can Retool call Contentful without holding the production key?",
      "answer": "Point Retool at /recipes/contentful-cma-proxy-retool edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins."
    },
    {
      "question": "Does POST traffic get cached?",
      "answer": "contentful-cma-proxy-retool keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Allowed origins on the contentful-cma-proxy-retool client token restrict which domains may call the edge URL."
    }
  ],
  "relatedRecipeSlugs": [
    "retool-public-app-hide-api-credentials",
    "call-contentful-from-flutterflow-securely"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/contentful-cma-proxy-retool",
    "markdown": "https://realcomposer.com/recipes/contentful-cma-proxy-retool.md",
    "json": "https://realcomposer.com/recipes/contentful-cma-proxy-retool.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=contentful-cma-proxy-retool&via=agent"
  }
}