RealComposer
ReactPaddleSecurity & Secret Vault

Call paddle api from react without leaking api key

SaaS billing lookups without Paddle secrets in React

Direct Answer & Architecture Summary

Proxy Paddle Billing API with restricted client tokens and vault-held API keys. For "call paddle api from react without leaking api key", store PADDLE_API_KEY in Secret Vault, call https://api.paddle.com/subscriptions/{{query.subscriptionId}} from a Worker, and let React hit only https://realcomposer.com/v1/workspace/call-paddle-api-from-react-securely with an rc_live_ client token.

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

Paddle keys in React network tabs

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

Critical Security & Operational Risks:
  • Shared React projects revealing Paddle tokens
  • Sudden Paddle 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 PADDLE_API_KEY vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2

Target the real upstream URL

Point step paddle at https://api.paddle.com/subscriptions/{{query.subscriptionId}} 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 React

Call https://realcomposer.com/v1/workspace/call-paddle-api-from-react-securely with a restricted rc_live_ client token. React never sends upstream secrets.

                    const res = await fetch('https://realcomposer.com/v1/workspace/call-paddle-api-from-react-securely', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
const data = await res.json();
                  
Payload Slimming Comparison
82% Bandwidth Reduction
Raw Upstream Response254 B
              {
  "requestId": "req_call-pad",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "call-paddle-api-from-react-securely"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload45 B
              {
  "subscriptionId": "sample",
  "status": "sample"
}
            

Recipe Specs

HTTP method
GET
Upstream calls
1
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
2
Payload
254 B to 45 B (-82%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/call-paddle-api-from-react-securely" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

What should React store instead of Paddle secrets?

Point React at /recipes/call-paddle-api-from-react-securely edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.

Will Anthropic or Linear prompt bodies be rewritten?

Cache key for call-paddle-api-from-react-securely: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.

Can I restrict which domains call this pipeline?

Upstream steps in call-paddle-api-from-react-securely honor timeoutMs and optional fallback JSON without leaking secrets.

Sources & Definitions Used in This Answer

Instant Deployment

Deploy this React + Paddle 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