RealComposer
Platform

React Edge API Recipes

Production-ready templates for calling third-party APIs from Reactwithout exposing secrets or maintaining a custom backend.

React safe & unsafe practices
Security & Secret Vault

How to Hide OpenAI API Key in Client-Side React Apps

To use OpenAI in a client-side React app without leaking your secret key, never include OPENAI_API_KEY or REACT_APP_OPENAI_API_KEY in frontend .env files. Instead, route your fetch calls through a RealComposer edge endpoint that injects your secret key server-side on Cloudflare Workers and enforces CORS origin whitelisting.

Sub-10ms edgeView Recipe
Security & Secret Vault

Call salesforce api from react without exposing access token

Vault-inject OAuth or integration tokens at the edge; React calls one public client token URL. For "call salesforce api from react without exposing access token", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let React hit only https://realcomposer.com/v1/workspace/call-salesforce-api-from-react-securely with an rc_live_ client token.

Sub-10ms edgeView Recipe
Security & Secret Vault

Call paddle api from react without leaking api key

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.

Sub-10ms edgeView Recipe
Security & Secret Vault

Hide intercom access token in react app

Intercom contacts and events via edge proxy with server-side Bearer token. For "hide intercom access token in react app", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/hide-intercom-access-token-react with an rc_live_ client token.

Sub-10ms edgeView Recipe
Multi-API Aggregation

Stitch firebase firestore with algolia search index

Firestore document fetch and Algolia query in one search-as-you-type call. For "stitch firebase firestore with algolia search index", store FIREBASE_ACCESS_TOKEN, ALGOLIA_API_KEY in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React hit only https://realcomposer.com/v1/workspace/stitch-firebase-with-algolia-search with an rc_live_ client token. POST upstream calls are not stored in caches.default; clients must send JSON bodies and headers forward unchanged.

Sub-10ms edgeView Recipe
Multi-API Aggregation

Combine intercom with posthog user events

Intercom conversation list plus PostHog person properties in one payload. For "combine intercom with posthog user events", store INTERCOM_ACCESS_TOKEN, POSTHOG_PERSONAL_API_KEY in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/combine-intercom-with-posthog-events with an rc_live_ client token.

Sub-10ms edgeView Recipe
Multi-API Aggregation

Merge cloudinary with shopify product images

Shopify product media plus Cloudinary derived URLs in one feed. For "merge cloudinary with shopify product images", store CLOUDINARY_BASIC_AUTH, SHOPIFY_ACCESS_TOKEN in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let React hit only https://realcomposer.com/v1/workspace/merge-cloudinary-with-shopify-images with an rc_live_ client token.

Sub-10ms edgeView Recipe
Payload Slimmer

Paddle subscription api trim json for dashboard

Select subscription id status and next bill date from Paddle objects. For "paddle subscription api trim json for dashboard", 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/paddle-subscription-json-trim-dashboard with an rc_live_ client token.

Sub-10ms edgeView Recipe
Payload Slimmer

Intercom conversation api payload reduce size

Map conversation id state and latest snippet for list UIs. For "intercom conversation api payload reduce size", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/reduce-intercom-conversation-payload with an rc_live_ client token.

Sub-10ms edgeView Recipe
Payload Slimmer

Intercom contact json slim for crm sidebar

Contact id email and company for quick context. For "intercom contact json slim for crm sidebar", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/slim-intercom-contact-json-sidebar with an rc_live_ client token.

Sub-10ms edgeView Recipe
Edge Caching & Rate Limits

Cache paddle pricing api for checkout page

TTL cache on catalog price endpoints during launches. For "cache paddle pricing api for checkout page", 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/cache-paddle-pricing-api-checkout with an rc_live_ client token. Enable 120s GET cache only when query params identify the resource.

Sub-10ms edgeView Recipe