Platform

React Edge API Recipes

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

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