Cloudflare Full Stack Integration

Production-tested patterns for wiring a React frontend to a Cloudflare Workers + Hono backend with Clerk authentication and D1, including an API client that attaches auth tokens automatically, a ProtectedRoute auth gate with loading states, CORS middleware for dev and production, Clerk JWT verification middleware, wrangler.jsonc bindings, .dev.vars environment variables, and @cloudflare/vite-plugin config (the Worker and frontend share one dev port, so relative /api URLs are correct). Use when connecting frontend to backend, implementing an auth flow, or troubleshooting CORS errors, 401 Unauthorized responses, auth tokens not passing, race conditions while auth is still loading, environment variable confusion, or D1 connection issues.

jackspace Updated

File contents

jackspace/ClaudeSkillz/tree/main/skills/cloudflare-full-stack-integration commit cbca4e9730

Frequently asked questions

npx skillmds@latest add jackspace/cloudflare-full-stack-integration