RealComposer
Frontend / WebREST APISecurity & Secret Vault

Reverse Proxy for Third Party API Key Protection

Vault-backed REST API proxy tuned for Frontend / Web

Direct Answer & Architecture Summary

Never place API_BEARER_TOKEN inside Frontend / Web source. RealComposer injects them when calling https://{{secrets.API_HOST}}/status, so browsers see only a client token.

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

REST API keys in Frontend / Web network tabs

Frontend / Web ships code or scripts to end-user devices. Any REST API bearer token in those bundles can be copied from DevTools, proxies, or repackaged apps.

Critical Security & Operational Risks:
  • Shared Frontend / Web projects revealing REST API tokens
  • Sudden REST API quota burn from scripted abuse
  • Inability to rotate keys without redeploying clients
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

Store upstream credentials in Secret Vault

Add API_BEARER_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.

2

Set headers, mapping, and cache TTL

Point step upstream at https://{{secrets.API_HOST}}/status with GET. Add output mapping fields that mirror the JSON contract your screen already expects. Leave cache TTL at 0 when each response is user-specific (include userId or record id in query params before enabling cache).

3

Call from Frontend / Web

Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.

                    const res = await fetch('https://realcomposer.com/v1/workspace/reverse-proxy-api-key-protection', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
                  
Payload Slimming Comparison
79% Bandwidth Reduction
Raw Upstream Response251 B
              {
  "requestId": "req_reverse-",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "reverse-proxy-api-key-protection"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload52 B
              {
  "userId": "sample",
  "name": "sample",
  "email": "sample"
}
            

Recipe Specs

HTTP method
GET
Upstream calls
1
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
3
Payload
251 B to 52 B (-79%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/reverse-proxy-api-key-protection" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

What should Frontend / Web store instead of REST API secrets?

Log request IDs for reverse-proxy-api-key-protection, not raw REST API payloads, because upstream bodies may include PII.

How do I forward JSON bodies to POST upstreams?

Cache key for reverse-proxy-api-key-protection: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.

Can I restrict which domains call this pipeline?

Allowed origins on the reverse-proxy-api-key-protection client token restrict which domains may call the edge URL.

Sources & Definitions Used in This Answer

Instant Deployment

Deploy this Frontend / Web + REST API 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