{
  "slug": "merge-github-user-and-repos",
  "title": "How to Merge Github Profile and Repos into One API Call",
  "metaTitle": "Merge Github Profile and Repos into - RealComposer",
  "metaDescription": "How to merge github profile and repos into one api call. Merge GitHub in one Frontend / Web call with parallel Worker steps.",
  "headline": "Parallel GitHub fetch merged before Frontend / Web hydrates",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 8,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "GitHub"
  ],
  "searchIntentQuery": "how to merge github profile and repos into one api call",
  "directAnswerSummary": "Instead of Frontend / Web firing serial fetches to GitHub, one pipeline hits https://api.github.com/user (and sibling steps) in parallel and returns mapped JSON.",
  "problem": {
    "title": "Waterfall latency from multiple GitHub requests",
    "explanation": "Frontend / Web widgets often await GitHub 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": "Add vault secrets for this pipeline",
      "description": "Add GITHUB_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Configure headersTemplate to inject vault secrets, target https://api.github.com/user, 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-github-user-and-repos with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/merge-github-user-and-repos', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "How to Merge Github Profile and Repos into One API Call",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "profile",
        "upstreamUrlTemplate": "https://api.github.com/user",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.GITHUB_TOKEN}}",
          "Accept": "application/vnd.github+json"
        },
        "timeoutMs": 3000
      },
      {
        "stepKey": "repos",
        "upstreamUrlTemplate": "https://api.github.com/user/repos?per_page=10",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.GITHUB_TOKEN}}",
          "Accept": "application/vnd.github+json"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "profile.repoId",
          "sourcePath": "0.id",
          "type": "number",
          "sourceStep": "profile"
        },
        {
          "targetPath": "profile.fullName",
          "sourcePath": "0.full_name",
          "type": "string",
          "sourceStep": "profile"
        },
        {
          "targetPath": "repos.repoId",
          "sourcePath": "0.id",
          "type": "number",
          "sourceStep": "repos"
        },
        {
          "targetPath": "repos.fullName",
          "sourcePath": "0.full_name",
          "type": "string",
          "sourceStep": "repos"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_merge-gi",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "merge-github-user-and-repos"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "profile_repoId": "sample",
    "profile_fullName": "sample",
    "repos_repoId": "sample",
    "repos_fullName": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/merge-github-user-and-repos\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Can Frontend / Web call GitHub without holding the production key?",
      "answer": "Log request IDs for merge-github-user-and-repos, not raw GitHub payloads, because upstream bodies may include PII."
    },
    {
      "question": "How do I forward JSON bodies to POST upstreams?",
      "answer": "merge-github-user-and-repos forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Upstream steps in merge-github-user-and-repos honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "call-rest-api-webflow-without-zapier",
    "retool-public-app-hide-api-credentials",
    "bff-without-express-or-docker"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/merge-github-user-and-repos",
    "markdown": "https://realcomposer.com/recipes/merge-github-user-and-repos.md",
    "json": "https://realcomposer.com/recipes/merge-github-user-and-repos.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=merge-github-user-and-repos&via=agent"
  }
}