The Problem
Most Cloudflare tutorials show very simple examples:- “Hello World” workers
- Basic KV counters
- Simple fetch proxies
“Okay, I can return ‘Hello World’ from the edge… but what can I actually build with this?”
The Solution
Cloudflare Experiments bridges this gap by providing a curated collection of real-world developer tools that run entirely on the Cloudflare edge. Every experiment in this repository is:Small and Focused
Each experiment demonstrates one specific capability of the Cloudflare platform:- Workers AI → AI Website Summary, GitHub Repo Explainer
- Browser Rendering → Screenshot API
- HTMLRewriter → Website to API, Dependency Analyzer
- Edge Networking → Is It Down, URL DNS Lookup
- D1 + KV → Link Shortener, R2 Storage
- Request Metadata → Where Am I, AI Bot Visibility
Independently Deployable
Every experiment is completely independent:- Dependencies (
package.json) - Configuration (
wrangler.json) - Types and utilities
- Deploy button
- Clone just one experiment
- Deploy just one experiment
- Fork just one experiment
- Modify one without touching others
Easy to Understand
Every experiment follows the same structure:- Use Hono for routing (fast, type-safe, Workers-optimized)
- Use TypeScript with strict typing
- Use shared error/success helpers (
jsonError,jsonSuccess) - Validate inputs (especially URLs) with clear error codes
- Include comprehensive error handling
Designed to Run Fast
Goal: Under 60 seconds from clicking “Deploy” to having a working API.
- Stateless first: Most experiments use edge compute and fetch—no persistent storage required
- No complex setup: Works with default Cloudflare settings where possible
- Minimal dependencies: Each experiment installs only what it needs
- Edge-optimized: Run close to users with sub-100ms response times
- Click Deploy button
- Authenticate with Cloudflare
- Worker is live in ~30 seconds
- Test:
curl "https://your-worker.workers.dev/check?url=https://example.com"
Click-to-Deploy Ready
Every experiment includes a Deploy to Cloudflare Workers button:- Try before you clone
- Deploy to production in one click
- Fork and modify the deploy URL to use your own repo
Design Principles
1. Real Tools, Not Demos
Every experiment is something you might actually want to use:Screenshot API
Real use case: Social media preview images, monitoring, archiving
Link Shortener
Real use case: URL shortening service with D1 persistence
Is It Down
Real use case: Website monitoring, uptime checks
AI Website Summary
Real use case: Content analysis, research tools, browser extensions
2. Edge-First Architecture
Cloudflare’s edge network spans 300+ cities. Experiments demonstrate how to leverage this: Example: Is It Down Instead of checking from a single server location:3. Platform Capabilities Over Abstractions
Experiments showcase native Cloudflare features: Workers AI (not external AI APIs):4. Consistent Code Standards
All experiments follow the same conventions: Error Handling:INVALID_URL- Bad or missing URL parameterFETCH_ERROR- Failed to fetch external resourceINTERNAL_ERROR- Uncaught exceptionNOT_FOUND- Resource doesn’t exist
5. TypeScript All the Way
Every experiment uses strict TypeScript:What This Means for You
As a Learner
You can:- Learn by example: See real implementations of Cloudflare features
- Copy and modify: Each experiment is a starting point for your own projects
- Understand the platform: See what’s possible with Workers, AI, D1, KV, etc.
As a Builder
You can:- Deploy immediately: Click-to-deploy to production
- Fork and customize: Each experiment is MIT licensed
- Build on top: Use experiments as building blocks for larger applications
As a Contributor
You can:- Add new experiments: Showcase other Cloudflare capabilities (Durable Objects, Queues, Vectorize)
- Improve existing ones: Better error handling, new features, performance optimizations
- Fix bugs: Help make the examples more robust
Future Directions
The collection will continue to grow with experiments demonstrating:- Durable Objects - Stateful coordination at the edge
- Queues - Asynchronous message processing
- Images API - On-the-fly image transformation
- Email Workers - Process incoming email
- Vectorize - Vector search at the edge
- Hyperdrive - Accelerate database queries
Each new experiment will follow the same principles: real tools, independently deployable, easy to understand, and edge-first.
Why It Matters
Cloudflare’s edge platform is incredibly powerful, but the learning curve can be steep. Cloudflare Experiments makes it tangible:- See concrete examples of what you can build
- Deploy real tools in under 60 seconds
- Learn platform capabilities through working code
- Build production patterns from day one
Get Involved
GitHub
Star the repo and explore the code
Contributing
Learn how to contribute your own experiments
Quick Start
Deploy your first experiment now
Discussions
Ask questions and share ideas