cloudflare-full-stack-integration

Integrate React frontends with Cloudflare Workers using Hono, Clerk, and D1.

204|30|Updated Nov 8, 2025
One-click install
npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-full-stack-integration-secondsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-full-stack-integration
Source: https://github.com/secondsky/claude-skills/tree/main/plugins/cloudflare-full-stack-integration/skills/cloudflare-full-stack-integration
Command: npx skills add https://github.com/secondsky/claude-skills --skill cloudflare-full-stack-integration-secondsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Production-tested patterns for integrating a React frontend with Cloudflare Workers using Hono, Clerk, and D1.

Core Features & Use Cases

  • Frontend-backend integration patterns
  • Clerk authentication integration
  • D1 database access from API routes
  • CORS handling and token attachment patterns
  • Protected routes and API middleware

Quick Start

Start with a complete template set and configure environment variables for Clerk, database bindings, and environment.

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?

Connecting React to Cloudflare Workers requires setting up a Hono API server on the Worker, configuring CORS to allow frontend requests, and using the @cloudflare/vite-plugin for local development port sharing. This pattern handles token attachment, environment variables, and D1 database bindings automatically.

How do I handle JWT tokens and authentication between React and Cloudflare Workers?

Integrate Clerk for authentication, attach JWT tokens automatically to API calls from React, and verify tokens in Hono middleware on the Worker. This ensures protected routes and secure session management across frontend and serverless backend.

Can I access a D1 database from Cloudflare Workers API routes?

Yes. D1 database bindings attach to your Hono routes as environment variables. Query the database directly from Worker endpoints, and the Skill provides patterns for secure, production-tested access from React API calls.

Why does my React app get CORS errors when calling Cloudflare Workers?

CORS preflight requests must be ordered correctly in Hono middleware before route handlers. This Skill includes tested patterns for CORS headers, preflight ordering, and token attachment that eliminate cross-origin request failures in production.

Do I need environment variables or secrets to deploy Clerk authentication with Cloudflare Workers?

Yes. You must configure Clerk API keys and D1 database bindings as environment variables in your Worker. The Skill provides setup patterns for local development with @cloudflare/vite-plugin and production deployment.

What's the best way to share a local development port between React and a Cloudflare Worker?

Use the @cloudflare/vite-plugin with Vite to run React and Hono on the same localhost port during development. This eliminates CORS setup friction and matches production routing behavior.