RealComposer
Frontend / WebGitHubSecurity & Secret Vault

Call Github API with Private Personal Access Token from Client

GitHub secrets stay out of Frontend / Web bundles

Direct Answer & Architecture Summary

Frontend / Web cannot safely store GitHub production keys. Vault-bound headers reach https://api.github.com/user/repos?per_page=5 on Workers while apps call your github-api-private-token-proxy edge URL.

Security LevelAES-256-GCM Vault
Edge LatencySub-10ms Response
InfrastructureZero Server Maintenance
The Problem Solved

Why Frontend / Web leaks GitHub credentials

Attackers routinely extract GitHub secrets from Frontend / Web builds. Direct browser calls also expose internal error payloads with hostnames.

Critical Security & Operational Risks:
  • Production GitHub keys copied from Frontend / Web bundles
  • Compliance violations after credential leaks
  • Attackers replaying vault-grade scopes from a laptop
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

Add vault secrets for this pipeline

Store GITHUB_TOKEN in the vault. Frontend / Web never embeds the raw secret, only a revocable rc_live_ client token.

2

Target the real upstream URL

Configure headersTemplate to inject vault secrets, target https://api.github.com/user/repos?per_page=5, and Add output mapping fields that mirror the JSON contract your screen already expects.

3

Call from Frontend / Web

Allowed origins on the token should list every Frontend / Web host that calls this URL.

                    const res = await fetch('https://realcomposer.com/v1/workspace/github-api-private-token-proxy', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
                  
Payload Slimming Comparison
76% Bandwidth Reduction
Raw Upstream Response249 B
              {
  "requestId": "req_github-a",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "github-api-private-token-proxy"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload60 B
              {
  "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
249 B to 60 B (-76%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/github-api-private-token-proxy" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

Can Frontend / Web call GitHub without holding the production key?

Use scoped tokens where the vendor allows them on github-api-private-token-proxy. Admin keys stay {{secrets.*}} references only.

How do I forward JSON bodies to POST upstreams?

github-api-private-token-proxy keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache.

How do I rotate upstream credentials?

Rotate vault secrets for github-api-private-token-proxy anytime; clients keep the same rc_live_ token.

Sources & Definitions Used in This Answer

Instant Deployment

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.

CLONE THIS RECIPE
Related Architecture Recipes