{
  "slug": "slim-github-api-response-mobile-widgets",
  "title": "Github API Response Payload Slimming for Mobile Widgets",
  "metaTitle": "Github API Response Payload - RealComposer",
  "metaDescription": "Github api response payload slimming for mobile widgets. Map only UI fields from GitHub before Mobile App (iOS & Android) parses JSON.",
  "headline": "GitHub payloads trimmed for Mobile App (iOS & Android) screens",
  "category": "slimmer",
  "categoryLabel": "Payload Slimmer",
  "urgency": 8,
  "clientPlatform": "Mobile App (iOS & Android)",
  "upstreamServices": [
    "GitHub"
  ],
  "searchIntentQuery": "github api response payload slimming for mobile widgets",
  "directAnswerSummary": "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.",
  "problem": {
    "title": "GitHub JSON bloat on Mobile App (iOS & Android)",
    "explanation": "Oversized GitHub payloads inflate parse time and mobile data charges for Mobile App (iOS & Android) users.",
    "risks": [
      "Main-thread JSON parse stalls on low-end phones",
      "Accidentally exposing PII fields to the client",
      "Downstream components re-render on unused keys"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Create GITHUB_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "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)."
    },
    {
      "stepNumber": 3,
      "title": "Call from Mobile App (iOS & Android)",
      "description": "Allowed origins on the token should list every Mobile App (iOS & Android) host that calls this URL.",
      "codeSnippet": "let url = URL(string: \"https://realcomposer.com/v1/workspace/slim-github-api-response-mobile-widgets\")!\nvar request = URLRequest(url: url)\nrequest.addValue(\"Bearer rc_live_token\", forHTTPHeaderField: \"Authorization\")"
    }
  ],
  "pipelineConfig": {
    "name": "Github API Response Payload Slimming for Mobile Widgets",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "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": "repoId",
          "sourcePath": "0.id",
          "type": "number",
          "sourceStep": "github"
        },
        {
          "targetPath": "fullName",
          "sourcePath": "0.full_name",
          "type": "string",
          "sourceStep": "github"
        },
        {
          "targetPath": "isPrivate",
          "sourcePath": "0.private",
          "type": "boolean",
          "sourceStep": "github"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "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"
      }
    }
  },
  "sampleSlimmedOutput": {
    "repoId": "sample",
    "fullName": "sample",
    "isPrivate": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/slim-github-api-response-mobile-widgets\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which GitHub credential belongs in the vault for this pipeline?",
      "answer": "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."
    },
    {
      "question": "Does POST traffic get cached?",
      "answer": "Cache key for slim-github-api-response-mobile-widgets: internal edge-cache path plus sorted query. Identical params hit; vary userId per user."
    },
    {
      "question": "Can I restrict which domains call this pipeline?",
      "answer": "Rotate vault secrets for slim-github-api-response-mobile-widgets anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "sub-10ms-api-for-mobile-apps",
    "secure-api-proxy-bubble-io",
    "stitch-two-rest-apis-flutterflow"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/slim-github-api-response-mobile-widgets",
    "markdown": "https://realcomposer.com/recipes/slim-github-api-response-mobile-widgets.md",
    "json": "https://realcomposer.com/recipes/slim-github-api-response-mobile-widgets.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=slim-github-api-response-mobile-widgets&via=agent"
  }
}