{
  "slug": "fix-cors-error-salesforce-webflow",
  "title": "Fix cors error calling salesforce api from webflow",
  "metaTitle": "Fix cors error calling salesforce - RealComposer",
  "metaDescription": "Fix cors error calling salesforce api from webflow. Edge OPTIONS and Allow-Origin for Salesforce REST proxy. Webflow CORS fix for Salesforce via.",
  "headline": "Webflow CRM embed without browser blocks",
  "category": "ecosystem",
  "categoryLabel": "Platforms & Frameworks",
  "urgency": 9,
  "clientPlatform": "Webflow",
  "upstreamServices": [
    "Salesforce"
  ],
  "searchIntentQuery": "fix cors error calling salesforce api from webflow",
  "directAnswerSummary": "Edge OPTIONS and Allow-Origin for Salesforce REST proxy. For \"fix cors error calling salesforce api from webflow\", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let Webflow hit only https://realcomposer.com/v1/workspace/fix-cors-error-salesforce-webflow with an rc_live_ client token.",
  "problem": {
    "title": "CORS blocks Salesforce in Webflow",
    "explanation": "Low-code Webflow tools expose connector tokens in shared workspaces, so Salesforce credentials leak to every editor.",
    "risks": [
      "Browser console CORS errors blocking launches",
      "Editors pasting secrets into reusable components",
      "Inability to test locally without disabling security"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Store SALESFORCE_ACCESS_TOKEN in the vault. Webflow never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "Configure headersTemplate to inject vault secrets, target https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}, and Add output mapping fields that mirror the JSON contract your screen already expects."
    },
    {
      "stepNumber": 3,
      "title": "Call from Webflow custom code",
      "description": "Call https://realcomposer.com/v1/workspace/fix-cors-error-salesforce-webflow with a restricted rc_live_ client token. Webflow never sends upstream secrets.",
      "codeSnippet": "fetch('https://realcomposer.com/v1/workspace/fix-cors-error-salesforce-webflow', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n}).then(r => r.json());"
    }
  ],
  "pipelineConfig": {
    "name": "Fix cors error calling salesforce api from webflow",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "salesforce",
        "upstreamUrlTemplate": "https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.SALESFORCE_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "contactId",
          "sourcePath": "Id",
          "type": "string",
          "sourceStep": "salesforce"
        },
        {
          "targetPath": "email",
          "sourcePath": "Email",
          "type": "string",
          "sourceStep": "salesforce"
        },
        {
          "targetPath": "name",
          "sourcePath": "Name",
          "type": "string",
          "sourceStep": "salesforce"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_fix-cors",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "fix-cors-error-salesforce-webflow"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "contactId": "sample",
    "email": "sample",
    "name": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/fix-cors-error-salesforce-webflow\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Can Webflow call Salesforce without holding the production key?",
      "answer": "Use scoped tokens where the vendor allows them on fix-cors-error-salesforce-webflow. Admin keys stay {{secrets.*}} references only."
    },
    {
      "question": "How do I forward JSON bodies to POST upstreams?",
      "answer": "fix-cors-error-salesforce-webflow POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Allowed origins on the fix-cors-error-salesforce-webflow client token restrict which domains may call the edge URL."
    }
  ],
  "relatedRecipeSlugs": [
    "fix-cors-error-webflow",
    "call-salesforce-from-bubble-securely"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/fix-cors-error-salesforce-webflow",
    "markdown": "https://realcomposer.com/recipes/fix-cors-error-salesforce-webflow.md",
    "json": "https://realcomposer.com/recipes/fix-cors-error-salesforce-webflow.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=fix-cors-error-salesforce-webflow&via=agent"
  }
}