cloudflare-full-stack-integration

Integrate React frontends with Cloudflare Workers using Clerk authentication and CORS configuration.

16|7|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/jackspace/ClaudeSkillz --skill cloudflare-full-stack-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-full-stack-integration
Source: https://github.com/jackspace/ClaudeSkillz/tree/main/skills/cloudflare-full-stack-integration
Command: npx skills add https://github.com/jackspace/ClaudeSkillz --skill cloudflare-full-stack-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Production-tested patterns for connecting React frontends to Cloudflare Worker backends using Hono and Clerk authentication, addressing CORS, token propagation, environment variables, and D1/KV integrations.

Core Features & Use Cases

  • Frontend/backend templates (api-client, ProtectedRoute) and backend middleware (CORS, Auth)
  • Complete guidance for wrangler.jsonc, vite.config.ts, and environment setup
  • Best practices to prevent common issues like 401s, CORS failures, and env-var confusion

Quick Start

Follow the quick-start to scaffold a Cloudflare + React project using the provided templates and run the dev server.

Frequently Asked Questions about cloudflare-full-stack-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a React frontend to a Cloudflare Worker backend with authentication?

Connect a React frontend to a Cloudflare Worker backend by configuring CORS in your Worker middleware, attaching Clerk JWT tokens automatically in your API client, and verifying tokens server-side using Clerk's JWT validation. This Skill provides templates and middleware patterns for end-to-end integration.

How do I set up CORS and token handling between React and Cloudflare Workers?

CORS and token handling require three components: CORS middleware in your Worker to accept frontend requests, automatic JWT attachment in your API client, and proper preflight response configuration. This Skill includes ready-to-use templates for both frontend and backend that handle these together.

Can I use Clerk authentication with Cloudflare Workers and D1?

Yes. Clerk JWT verification runs in your Worker middleware to authenticate requests, then your verified token provides access to D1 databases via Worker bindings. This Skill covers the full flow including environment variable configuration for development and production.

What's the correct way to configure environment variables and bindings for a Cloudflare full-stack app?

Configure wrangler.jsonc with D1 and KV bindings, use Vite plugin configuration for frontend access, and manage secrets separately in development and production. This Skill provides complete wrangler.jsonc and vite.config.ts templates that prevent common env-var and binding access issues.

Why am I getting 401 errors or CORS failures with my Cloudflare Worker and React app?

401 and CORS errors typically stem from incorrect middleware ordering, missing token attachment in API requests, or misconfigured CORS headers. This Skill diagnoses these issues and shows the exact middleware sequence and client setup needed to prevent them.

How do I scaffold and run a Cloudflare Workers project with React and Hono?

Use the provided frontend and backend templates with Hono framework, configure wrangler.jsonc and vite.config.ts, then run the dev server. This Skill includes quick-start scaffolding that sets up the full integration so you start with a working foundation.