{
  "slug": "stitch-contentful-with-shopify-products",
  "title": "Stitch contentful entries with shopify products api",
  "metaTitle": "Stitch contentful entries with - RealComposer",
  "metaDescription": "Stitch contentful entries with shopify products api. Merge Contentful and Shopify in one Next.js / React call with parallel Worker steps.",
  "headline": "Commerce pages with CMS copy and live catalog",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 9,
  "clientPlatform": "Next.js / React",
  "upstreamServices": [
    "Contentful",
    "Shopify"
  ],
  "searchIntentQuery": "stitch contentful entries with shopify products api",
  "directAnswerSummary": "Contentful marketing fields plus Shopify SKU inventory in parallel. For \"stitch contentful entries with shopify products api\", store CONTENTFUL_ACCESS_TOKEN, SHOPIFY_ACCESS_TOKEN in Secret Vault, call https://cdn.contentful.com/spaces/{{query.spaceId}}/entries from a Worker, and let Next.js / React hit only https://realcomposer.com/v1/workspace/stitch-contentful-with-shopify-products with an rc_live_ client token.",
  "problem": {
    "title": "Serial Contentful and Shopify calls slow Next.js / React pages",
    "explanation": "Each extra Contentful and Shopify hop adds hundreds of milliseconds and another OAuth refresh path your UI must manage.",
    "risks": [
      "One slow upstream blocking an entire page",
      "Partial failures leaving UI in inconsistent states",
      "Duplicate auth refresh logic per service"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Store CONTENTFUL_ACCESS_TOKEN, SHOPIFY_ACCESS_TOKEN in the vault. Next.js / React never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Configure headersTemplate to inject vault secrets, target https://cdn.contentful.com/spaces/{{query.spaceId}}/entries, and Add output mapping fields that mirror the JSON contract your screen already expects."
    },
    {
      "stepNumber": 3,
      "title": "Call from Next.js / React",
      "description": "Allowed origins on the token should list every Next.js / React host that calls this URL.",
      "codeSnippet": "// app/api route or client component\nconst res = await fetch('https://realcomposer.com/v1/workspace/stitch-contentful-with-shopify-products', {\n  cache: 'no-store',\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Stitch contentful entries with shopify products api",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "contentful",
        "upstreamUrlTemplate": "https://cdn.contentful.com/spaces/{{query.spaceId}}/entries",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.CONTENTFUL_ACCESS_TOKEN}}"
        },
        "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": "contentful.entryId",
          "sourcePath": "items.0.sys.id",
          "type": "string",
          "sourceStep": "contentful"
        },
        {
          "targetPath": "contentful.title",
          "sourcePath": "items.0.fields.title",
          "type": "string",
          "sourceStep": "contentful"
        },
        {
          "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_stitch-c",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "stitch-contentful-with-shopify-products"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "contentful_entryId": "sample",
    "contentful_title": "sample",
    "shopify_productId": "sample",
    "shopify_title": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/stitch-contentful-with-shopify-products\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which Contentful credential belongs in the vault for this pipeline?",
      "answer": "Point Next.js / React at /recipes/stitch-contentful-with-shopify-products edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins."
    },
    {
      "question": "Does POST traffic get cached?",
      "answer": "stitch-contentful-with-shopify-products vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Rotate vault secrets for stitch-contentful-with-shopify-products anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "merge-airtable-and-shopify",
    "merge-contentful-with-live-pricing"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/stitch-contentful-with-shopify-products",
    "markdown": "https://realcomposer.com/recipes/stitch-contentful-with-shopify-products.md",
    "json": "https://realcomposer.com/recipes/stitch-contentful-with-shopify-products.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=stitch-contentful-with-shopify-products&via=agent"
  }
}