{
  "slug": "merge-contentful-with-live-pricing",
  "title": "Merge Contentful Cms Data with Real Time Pricing API",
  "metaTitle": "Merge Contentful Cms Data with Real - RealComposer",
  "metaDescription": "Merge contentful cms data with real time pricing api. Merge Contentful and Stripe in one Frontend / Web call with parallel Worker steps.",
  "headline": "Parallel Contentful fetch merged before Frontend / Web hydrates",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 8,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Contentful",
    "Stripe"
  ],
  "searchIntentQuery": "merge contentful cms data with real time pricing api",
  "directAnswerSummary": "Instead of Frontend / Web firing serial fetches to Contentful and Stripe, one pipeline hits https://cdn.contentful.com/spaces/{{query.spaceId}}/entries (and sibling steps) in parallel and returns mapped JSON.",
  "problem": {
    "title": "Waterfall latency from multiple Contentful and Stripe requests",
    "explanation": "Frontend / Web widgets often await Contentful and Stripe 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": "Bind vault keys to the Worker",
      "description": "Store CONTENTFUL_ACCESS_TOKEN, STRIPE_SECRET_KEY in the vault. Frontend / Web 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 Frontend / Web",
      "description": "Call https://realcomposer.com/v1/workspace/merge-contentful-with-live-pricing with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/merge-contentful-with-live-pricing', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Merge Contentful Cms Data with Real Time Pricing 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": "stripe",
        "upstreamUrlTemplate": "https://api.stripe.com/v1/customers/{{query.customerId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.STRIPE_SECRET_KEY}}"
        },
        "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": "stripe.customerId",
          "sourcePath": "id",
          "type": "string",
          "sourceStep": "stripe"
        },
        {
          "targetPath": "stripe.email",
          "sourcePath": "email",
          "type": "string",
          "sourceStep": "stripe"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_merge-co",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "merge-contentful-with-live-pricing"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "contentful_entryId": "sample",
    "contentful_title": "sample",
    "stripe_customerId": "sample",
    "stripe_email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/merge-contentful-with-live-pricing\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "What should Frontend / Web store instead of Contentful secrets?",
      "answer": "Log request IDs for merge-contentful-with-live-pricing, not raw Contentful payloads, because upstream bodies may include PII."
    },
    {
      "question": "How do I forward JSON bodies to POST upstreams?",
      "answer": "merge-contentful-with-live-pricing vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Rotate vault secrets for merge-contentful-with-live-pricing anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "api-composition-tool-low-code",
    "merge-notion-and-google-calendar",
    "stitch-two-rest-apis-flutterflow"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/merge-contentful-with-live-pricing",
    "markdown": "https://realcomposer.com/recipes/merge-contentful-with-live-pricing.md",
    "json": "https://realcomposer.com/recipes/merge-contentful-with-live-pricing.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=merge-contentful-with-live-pricing&via=agent"
  }
}