How to Merge Github Profile and Repos into One API Call
Parallel GitHub fetch merged before Frontend / Web hydrates
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.
Waterfall latency from multiple GitHub requests
Frontend / Web widgets often await GitHub sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.
- Race conditions between parallel manual fetches
- Higher mobile data usage from redundant JSON
- Timeouts when any upstream exceeds cellular RTT
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Add GITHUB_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Target the real upstream URL
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.
Call from Frontend / Web
Call https://realcomposer.com/v1/workspace/merge-github-user-and-repos with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.
const res = await fetch('https://realcomposer.com/v1/workspace/merge-github-user-and-repos', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"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"
}
}
}
{
"profile_repoId": "sample",
"profile_fullName": "sample",
"repos_repoId": "sample",
"repos_fullName": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 2
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 4
- Payload
- 246 B to 105 B (-57%)
curl -X GET "https://realcomposer.com/v1/workspace/merge-github-user-and-repos" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Can Frontend / Web call GitHub without holding the production key?
Log request IDs for merge-github-user-and-repos, not raw GitHub payloads, because upstream bodies may include PII.
How do I forward JSON bodies to POST upstreams?
merge-github-user-and-repos forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.
What happens if an upstream step times out?
Upstream steps in merge-github-user-and-repos honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + GitHub Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.