{
  "slug": "merge-cloudinary-with-shopify-images",
  "title": "Merge cloudinary with shopify product images",
  "metaDescription": "Merge cloudinary with shopify product images. Shopify product media plus Cloudinary derived URLs in o. Merge Cloudinary and Shopify in one React call.",
  "headline": "Product gallery with CDN transforms",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 8,
  "clientPlatform": "React",
  "upstreamServices": [
    "Cloudinary",
    "Shopify"
  ],
  "searchIntentQuery": "merge cloudinary with shopify product images",
  "directAnswerSummary": "Shopify product media plus Cloudinary derived URLs in one feed. For \"merge cloudinary with shopify product images\", store CLOUDINARY_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let React hit only https://realcomposer.com/v1/workspace/merge-cloudinary-with-shopify-images with an rc_live_ client token.",
  "problem": {
    "title": "Waterfall latency from multiple Cloudinary and Shopify requests",
    "explanation": "React widgets often await Cloudinary and Shopify sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.",
    "risks": [
      "Race conditions between parallel manual fetches",
      "Higher mobile data usage from redundant JSON",
      "Timeouts when any upstream exceeds cellular RTT"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Store upstream credentials in Secret Vault",
      "description": "Store CLOUDINARY_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN in the vault. React never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Configure upstream steps and output mapping",
      "description": "Use GET against https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image. 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": "Call from React",
      "description": "Allowed origins on the token should list every React host that calls this URL.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/merge-cloudinary-with-shopify-images', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});\nconst data = await res.json();"
    }
  ],
  "pipelineConfig": {
    "name": "Merge cloudinary with shopify product images",
    "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
      },
      {
        "stepKey": "shopify",
        "upstreamUrlTemplate": "https://{{secrets.SHOPIFY_STORE}}.myshopify.com/admin/api/2026-10/products.json?limit=5",
        "httpMethod": "GET",
        "headersTemplate": {
          "X-Shopify-Access-Token": "{{secrets.SHOPIFY_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "cloudinary.publicId",
          "sourcePath": "resources.0.public_id",
          "type": "string",
          "sourceStep": "cloudinary"
        },
        {
          "targetPath": "cloudinary.format",
          "sourcePath": "resources.0.format",
          "type": "string",
          "sourceStep": "cloudinary"
        },
        {
          "targetPath": "shopify.productId",
          "sourcePath": "products.0.id",
          "type": "number",
          "sourceStep": "shopify"
        },
        {
          "targetPath": "shopify.title",
          "sourcePath": "products.0.title",
          "type": "string",
          "sourceStep": "shopify"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_merge-cl",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "merge-cloudinary-with-shopify-images"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "cloudinary_publicId": "sample",
    "cloudinary_format": "sample",
    "shopify_productId": "sample",
    "shopify_title": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/merge-cloudinary-with-shopify-images\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which Cloudinary credential belongs in the vault for this pipeline?",
      "answer": "Store CLOUDINARY_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN for merge-cloudinary-with-shopify-images. React never sees decrypted values."
    },
    {
      "question": "Does POST traffic get cached?",
      "answer": "merge-cloudinary-with-shopify-images 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 merge-cloudinary-with-shopify-images client token restrict which domains may call the edge URL."
    }
  ],
  "relatedRecipeSlugs": [
    "reduce-shopify-order-json-payload",
    "merge-airtable-and-shopify"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/merge-cloudinary-with-shopify-images",
    "markdown": "https://realcomposer.com/recipes/merge-cloudinary-with-shopify-images.md",
    "json": "https://realcomposer.com/recipes/merge-cloudinary-with-shopify-images.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=merge-cloudinary-with-shopify-images&via=agent"
  }
}