{
  "slug": "best-api-gateway-cloudinary-react-native",
  "title": "React native api gateway for cloudinary uploads",
  "metaTitle": "React native api gateway for - RealComposer",
  "metaDescription": "React native api gateway for cloudinary uploads. React Native CORS fix for Cloudinary via RealComposer OPTIONS plus vault headers.",
  "headline": "Mobile media uploads via edge signing",
  "category": "ecosystem",
  "categoryLabel": "Platforms & Frameworks",
  "urgency": 8,
  "clientPlatform": "React Native",
  "upstreamServices": [
    "Cloudinary"
  ],
  "searchIntentQuery": "react native api gateway for cloudinary uploads",
  "directAnswerSummary": "Sign Cloudinary uploads at the edge instead of shipping API secrets in the app bundle. For \"react native api gateway for cloudinary uploads\", store CLOUDINARY_BASIC_AUTH in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/best-api-gateway-cloudinary-react-native with an rc_live_ client token.",
  "problem": {
    "title": "CORS blocks Cloudinary in React Native",
    "explanation": "Low-code React Native tools expose connector tokens in shared workspaces, so Cloudinary 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": "Store upstream credentials in Secret Vault",
      "description": "Store CLOUDINARY_BASIC_AUTH in the vault. React Native never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Point step cloudinary at https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image with GET. Add output mapping fields that mirror the JSON contract your screen already expects. 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": "Call from React Native",
      "description": "Allowed origins on the token should list every React Native host that calls this URL.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/best-api-gateway-cloudinary-react-native', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "React native api gateway for cloudinary uploads",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "cloudinary",
        "upstreamUrlTemplate": "https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Basic {{secrets.CLOUDINARY_BASIC_AUTH}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "publicId",
          "sourcePath": "resources.0.public_id",
          "type": "string",
          "sourceStep": "cloudinary"
        },
        {
          "targetPath": "format",
          "sourcePath": "resources.0.format",
          "type": "string",
          "sourceStep": "cloudinary"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_best-api",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "best-api-gateway-cloudinary-react-native"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "publicId": "sample",
    "format": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/best-api-gateway-cloudinary-react-native\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which Cloudinary credential belongs in the vault for this pipeline?",
      "answer": "Log request IDs for best-api-gateway-cloudinary-react-native, not raw Cloudinary payloads, because upstream bodies may include PII."
    },
    {
      "question": "What cache key does RealComposer use?",
      "answer": "Cache key for best-api-gateway-cloudinary-react-native: internal edge-cache path plus sorted query. Identical params hit; vary userId per user."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Upstream steps in best-api-gateway-cloudinary-react-native honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "best-api-gateway-react-native",
    "cloudinary-upload-proxy-framer"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/best-api-gateway-cloudinary-react-native",
    "markdown": "https://realcomposer.com/recipes/best-api-gateway-cloudinary-react-native.md",
    "json": "https://realcomposer.com/recipes/best-api-gateway-cloudinary-react-native.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=best-api-gateway-cloudinary-react-native&via=agent"
  }
}