{
  "slug": "merge-linear-and-github-pr-api",
  "title": "Merge Linear Issues and Github Pull Requests into One Dashboard API",
  "metaTitle": "Merge Linear Issues and Github Pull - RealComposer",
  "metaDescription": "Merge linear issues and github pull requests into one dashboard api. Merge Linear and GitHub in one Frontend / Web call with parallel Worker steps.",
  "headline": "Parallel Linear fetch merged before Frontend / Web hydrates",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 8,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Linear",
    "GitHub"
  ],
  "searchIntentQuery": "merge linear issues and github pull requests into one dashboard api",
  "directAnswerSummary": "Instead of Frontend / Web firing serial fetches to Linear and GitHub, one pipeline hits https://api.linear.app/graphql (and sibling steps) in parallel and returns mapped JSON.",
  "problem": {
    "title": "Waterfall latency from multiple Linear and GitHub requests",
    "explanation": "Frontend / Web widgets often await Linear and 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": "Store upstream credentials in Secret Vault",
      "description": "Add LINEAR_API_KEY, GITHUB_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Configure upstream steps and output mapping",
      "description": "Configure headersTemplate to inject vault secrets, target https://api.linear.app/graphql, and Add output mapping fields that mirror the JSON contract your screen already expects."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Allowed origins on the token should list every Frontend / Web host that calls this URL.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/merge-linear-and-github-pr-api', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Merge Linear Issues and Github Pull Requests into One Dashboard API",
    "method": "POST",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "linear",
        "upstreamUrlTemplate": "https://api.linear.app/graphql",
        "httpMethod": "POST",
        "headersTemplate": {
          "Authorization": "{{secrets.LINEAR_API_KEY}}",
          "Content-Type": "application/json"
        },
        "timeoutMs": 10000
      },
      {
        "stepKey": "github",
        "upstreamUrlTemplate": "https://api.github.com/user/repos?per_page=5",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.GITHUB_TOKEN}}",
          "Accept": "application/vnd.github+json"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "linear.issueId",
          "sourcePath": "data.issue.id",
          "type": "string",
          "sourceStep": "linear"
        },
        {
          "targetPath": "linear.title",
          "sourcePath": "data.issue.title",
          "type": "string",
          "sourceStep": "linear"
        },
        {
          "targetPath": "github.repoId",
          "sourcePath": "0.id",
          "type": "number",
          "sourceStep": "github"
        },
        {
          "targetPath": "github.fullName",
          "sourcePath": "0.full_name",
          "type": "string",
          "sourceStep": "github"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_merge-li",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "merge-linear-and-github-pr-api"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "linear_issueId": "sample",
    "linear_title": "sample",
    "github_repoId": "sample",
    "github_fullName": "sample"
  },
  "curlSnippet": "curl -X POST \"https://realcomposer.com/v1/workspace/merge-linear-and-github-pr-api\" \\\n  -H \"Authorization: Bearer rc_live_client_token\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"example\"}'",
  "faqs": [
    {
      "question": "Can Frontend / Web call Linear without holding the production key?",
      "answer": "Log request IDs for merge-linear-and-github-pr-api, not raw Linear payloads, because upstream bodies may include PII."
    },
    {
      "question": "How do I forward JSON bodies to POST upstreams?",
      "answer": "merge-linear-and-github-pr-api keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache."
    },
    {
      "question": "Can I restrict which domains call this pipeline?",
      "answer": "Allowed origins on the merge-linear-and-github-pr-api client token restrict which domains may call the edge URL."
    }
  ],
  "relatedRecipeSlugs": [
    "combine-stripe-customer-and-invoices",
    "hide-api-key-framer",
    "cache-airtable-avoid-rate-limits"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/merge-linear-and-github-pr-api",
    "markdown": "https://realcomposer.com/recipes/merge-linear-and-github-pr-api.md",
    "json": "https://realcomposer.com/recipes/merge-linear-and-github-pr-api.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=merge-linear-and-github-pr-api&via=agent"
  }
}