RealComposer
Frontend / WebClerkSecurity & Secret Vault

Call Clerk Backend API from Client Side

Vault-backed Clerk proxy tuned for Frontend / Web

Direct Answer & Architecture Summary

Never place CLERK_SECRET_KEY inside Frontend / Web source. RealComposer injects them when calling https://api.clerk.com/v1/users/{{query.userId}}, so browsers see only a client token.

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

Clerk keys in Frontend / Web network tabs

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

Critical Security & Operational Risks:
  • Shared Frontend / Web projects revealing Clerk tokens
  • Sudden Clerk 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

Add vault secrets for this pipeline

Create CLERK_SECRET_KEY vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2

Target the real upstream URL

Point step clerk at https://api.clerk.com/v1/users/{{query.userId}} 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

Call https://realcomposer.com/v1/workspace/clerk-backend-api-proxy with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.

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

Recipe Specs

HTTP method
GET
Upstream calls
1
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
2
Payload
242 B to 36 B (-85%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/clerk-backend-api-proxy" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

Does Frontend / Web need CORS changes after adding RealComposer?

Yes for clerk-backend-api-proxy. Ship only an rc_live_ client token in Frontend / Web; RealComposer injects CLERK_SECRET_KEY on https://api.clerk.com/v1/users/{{query.userId}}.

What cache key does RealComposer use?

clerk-backend-api-proxy forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.

How do I rotate upstream credentials?

Upstream steps in clerk-backend-api-proxy honor timeoutMs and optional fallback JSON without leaking secrets.

Sources & Definitions Used in This Answer

Instant Deployment

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