{
  "slug": "hide-api-key-framer",
  "title": "How to Hide API Keys in Framer Websites",
  "metaDescription": "Hide API keys in Framer websites. Route fetch requests through RealComposer edge gateways to inject secrets server-side and enforce origin protection.",
  "headline": "Secure Edge Proxy for Framer React Components & Interactions",
  "category": "security",
  "categoryLabel": "Security & Secret Vault",
  "urgency": 10,
  "clientPlatform": "Framer",
  "upstreamServices": [
    "OpenAI",
    "Airtable",
    "Resend"
  ],
  "searchIntentQuery": "hide api key in framer website",
  "directAnswerSummary": "Framer generates pure React client components where hardcoded API keys are visible to anyone viewing browser source code. Route requests through RealComposer to inject secrets at the edge and enforce domain origin protection.",
  "problem": {
    "title": "Framer Code Components Run Exclusively in the Browser",
    "explanation": "Framer code overrides and components compile into browser-executed JavaScript with zero server privacy.",
    "risks": [
      "Leaked API keys in public JS bundles",
      "Quota theft by competitors",
      "CORS blocking from third-party APIs"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Store Secret in RealComposer",
      "description": "Save private API token in AES-256 Vault."
    },
    {
      "stepNumber": 2,
      "title": "Fetch from Framer Component",
      "description": "Call RealComposer endpoint using public token."
    }
  ],
  "pipelineConfig": {
    "name": "Framer Edge Proxy",
    "method": "POST",
    "cacheTtlSeconds": 0,
    "steps": [
      {
        "stepKey": "resend",
        "upstreamUrlTemplate": "https://api.resend.com/emails",
        "httpMethod": "POST",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.RESEND_API_KEY}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "messageId",
          "sourceStep": "resend",
          "sourcePath": "id"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "id": "email_99a8",
    "from": "hello@startup.com",
    "to": [
      "user@example.com"
    ]
  },
  "sampleSlimmedOutput": {
    "messageId": "email_99a8"
  },
  "curlSnippet": "curl -X POST \"https://realcomposer.com/v1/acme/framer-email\"",
  "faqs": [
    {
      "question": "Can I restrict calls to my Framer domain?",
      "answer": "Yes, RealComposer client tokens allow strict origin whitelisting."
    }
  ],
  "relatedRecipeSlugs": [
    "call-private-api-from-webflow-securely",
    "resend-email-api-static-site"
  ],
  "links": {
    "page": "https://realcomposer.com/recipes/hide-api-key-framer",
    "markdown": "https://realcomposer.com/recipes/hide-api-key-framer.md",
    "json": "https://realcomposer.com/recipes/hide-api-key-framer.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=hide-api-key-framer&via=agent"
  }
}