cloudflare-pages-workers
Use when deploying to Cloudflare Pages or Workers — static sites, full-stack apps, edge computing, D1 database, R2 storage, or KV. Also use when choosing between Vercel and Cloudflare or building on the Cloudflare developer platform.
| Model | Source |
|---|---|
| sonnet | pack: deploy |
Full Reference
┏━ 🚀 cloudflare-pages-workers ━━━━━━━━━━━━━━━━━━┓ ┃ Use when deploying to Cloudflare Pages or Work… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Cloudflare Pages & Workers
Section titled “Cloudflare Pages & Workers”Cloudflare’s developer platform runs on V8 isolates at the edge — not Node.js. Wrangler v4 (March 2025) is the current CLI. D1 is GA. Workers billing is CPU-time based — idle I/O wait is free. Pages is best for static sites with edge functions; Workers is best for pure APIs and microservices.
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Wrangler version | v4 (current) |
| Install | npm install -g wrangler |
| Docs | https://developers.cloudflare.com/workers/ |
| Auth method | wrangler login (browser OAuth) |
| Key env vars | CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID (for CI) |
| Dev server | wrangler dev |
| Deploy Worker | wrangler deploy |
| Deploy Pages | wrangler pages deploy <dir> |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Deploy a Pages static site, use file-based routing, write middleware, or choose Pages vs Workers | reference/pages-setup.md |
| Initialize a Worker, configure wrangler.toml, write an entrypoint, or run dev/deploy commands | reference/workers-setup.md |
| Use D1, R2, or KV — configure bindings and query the APIs | reference/bindings.md |
| Configure vars vs secrets, set secrets via CLI, or access them in a handler | reference/env-secrets.md |
| Set up custom domains, Workers routes, _redirects, Node.js compat, or ctx.waitUntil | reference/domains-routing.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.