Github API Response Payload Slimming for Mobile Widgets
GitHub payloads trimmed for Mobile App (iOS & Android) screens
Answer "github api response payload slimming for mobile widgets" by projecting GitHub data server-side: upstream https://api.github.com/user/repos?per_page=5, client sees only mapped keys.
GitHub JSON bloat on Mobile App (iOS & Android)
Oversized GitHub payloads inflate parse time and mobile data charges for Mobile App (iOS & Android) users.
- Main-thread JSON parse stalls on low-end phones
- Accidentally exposing PII fields to the client
- Downstream components re-render on unused keys
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Create GITHUB_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.
Target the real upstream URL
Use GET against https://api.github.com/user/repos?per_page=5. Allowed origins on the client token should match leave cache ttl at 0 when each response is user-specific (include userid or record id in query params before enabling cache).
Call from Mobile App (iOS & Android)
Allowed origins on the token should list every Mobile App (iOS & Android) host that calls this URL.
let url = URL(string: "https://realcomposer.com/v1/workspace/slim-github-api-response-mobile-widgets")!
var request = URLRequest(url: url)
request.addValue("Bearer rc_live_token", forHTTPHeaderField: "Authorization")
{
"requestId": "req_slim-git",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "slim-github-api-response-mobile-widgets"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"repoId": "sample",
"fullName": "sample",
"isPrivate": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 3
- Payload
- 258 B to 60 B (-77%)
curl -X GET "https://realcomposer.com/v1/workspace/slim-github-api-response-mobile-widgets" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Which GitHub credential belongs in the vault for this pipeline?
Point Mobile App (iOS & Android) at /recipes/slim-github-api-response-mobile-widgets edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.
Does POST traffic get cached?
Cache key for slim-github-api-response-mobile-widgets: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.
Can I restrict which domains call this pipeline?
Rotate vault secrets for slim-github-api-response-mobile-widgets anytime; clients keep the same rc_live_ token.
Sources & Definitions Used in This Answer
Deploy this Mobile App (iOS & Android) + GitHub Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.