{
  "slug": "connect-custom-rest-api-to-framer",
  "title": "How to Connect Custom REST API to Framer",
  "metaDescription": "How to connect custom rest api to framer. Framer CORS fix for REST API via RealComposer OPTIONS plus vault headers. RealComposer edge vault and client toke",
  "headline": "Low-code REST API BFF for Framer",
  "category": "ecosystem",
  "categoryLabel": "Platforms & Frameworks",
  "urgency": 8,
  "clientPlatform": "Framer",
  "upstreamServices": [
    "REST API"
  ],
  "searchIntentQuery": "how to connect custom rest api to framer",
  "directAnswerSummary": "Framer 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.",
  "problem": {
    "title": "Framer cannot attach secret headers to REST API",
    "explanation": "Framer runs in the browser or a sandbox without a secret store. REST API rejects unsigned browser origins or requires server-only headers.",
    "risks": [
      "Proxy hacks that break when vendors tighten CSP",
      "Zapier-only workarounds adding cost and latency",
      "Guest users seeing failed network requests in demos"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Create API_BEARER_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Configure upstream steps and output mapping",
      "description": "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)."
    },
    {
      "stepNumber": 3,
      "title": "Fetch inside Framer overrides",
      "description": "Allowed origins on the token should list every Framer host that calls this URL.",
      "codeSnippet": "fetch('https://realcomposer.com/v1/workspace/connect-custom-rest-api-to-framer', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "How to Connect Custom REST API to Framer",
    "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"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_connect-",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "connect-custom-rest-api-to-framer"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "userId": "sample",
    "name": "sample",
    "email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/connect-custom-rest-api-to-framer\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Is it safe to log REST API responses in Framer?",
      "answer": "Point Framer at /recipes/connect-custom-rest-api-to-framer edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins."
    },
    {
      "question": "Will Anthropic or Linear prompt bodies be rewritten?",
      "answer": "connect-custom-rest-api-to-framer POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Upstream steps in connect-custom-rest-api-to-framer honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "slim-notion-block-children-payload",
    "plaid-api-proxy-flutter",
    "avoid-stripe-api-rate-limit"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/connect-custom-rest-api-to-framer",
    "markdown": "https://realcomposer.com/recipes/connect-custom-rest-api-to-framer.md",
    "json": "https://realcomposer.com/recipes/connect-custom-rest-api-to-framer.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=connect-custom-rest-api-to-framer&via=agent"
  }
}