A lightweight, shareable online clipboard built on Cloudflare Workers + KV β no accounts, no fuss. Just visit a URL, paste your text, and share the link.
- Instant sharing β every clipboard lives at
https://<your-worker>.workers.dev/<key> - Auto-generated keys β visiting the root
/redirects you to a fresh random key - Persistent storage β content is backed by Cloudflare KV, globally distributed
- Zero infrastructure β runs entirely on Cloudflare's edge network, no servers to manage
- React SPA β fast, responsive frontend served as static assets
clipboard/
βββ src/
β βββ index.ts # Hono worker β API routes (GET /api/:key, PUT /api/:key)
β βββ client/
β βββ main.tsx # React app entry point
β βββ App.tsx # Main clipboard component (key routing, editor, save)
β βββ index.css # Styles
βββ index.html # Vite HTML shell
βββ wrangler.jsonc # Cloudflare Workers config (KV bindings, assets)
βββ vite.config.ts # Vite + Cloudflare plugin config
βββ tsconfig.json
βββ package.json
Browser (React SPA)
β
β GET /api/:key β read from KV
β PUT /api/:key β write to KV
βΌ
Hono Worker (src/index.ts)
β
βΌ
Cloudflare KV (CLIPBOARD_KV binding)
Static assets (dist/client/) are served directly by Cloudflare's asset pipeline β the Worker only handles /api/* requests.
| Tool | Version | Install |
|---|---|---|
| Node.js | >= 18 | nodejs.org |
| npm | >= 9 | bundled with Node |
| Wrangler CLI | >= 4 | npm install -g wrangler |
| Cloudflare account | β | dash.cloudflare.com |
wrangler loginThis opens a browser window to authorise Wrangler against your Cloudflare account.
Cloudflare KV requires you to create namespaces before you can use them.
# Production namespace
wrangler kv namespace create CLIPBOARD_KV
# Preview namespace (used by `wrangler dev`)
wrangler kv namespace create CLIPBOARD_KV --previewEach command prints an id. Copy both IDs into wrangler.jsonc:
npm installWrangler can auto-generate a worker-configuration.d.ts file that gives you full type-safety for your bindings:
npm run cf-typegennpm run devVite starts a local dev server (typically at http://localhost:5173). The @cloudflare/vite-plugin emulates Workers bindings locally β your KV reads/writes hit the preview namespace in real Cloudflare KV.
npm run deployThis runs vite build (outputs to dist/) followed by wrangler deploy. Wrangler uploads:
- Worker script (
src/index.ts, bundled) - Static assets (
dist/client/) β served by Cloudflare's asset pipeline
Your clipboard is now live at:
https://clipboard.<your-account>.workers.dev
Tip: To use a custom domain, add a route or custom domain in the Cloudflare dashboard under Workers & Pages β your worker β Settings β Domains & Routes.
Simply re-run:
npm run deployWrangler performs an atomic deployment β the new version is live instantly with zero downtime.
| Field | File | Description |
|---|---|---|
name |
wrangler.jsonc |
Worker name (also the default subdomain) |
compatibility_date |
wrangler.jsonc |
Pins the Workers runtime version |
kv_namespaces[].id |
wrangler.jsonc |
Production KV namespace ID |
kv_namespaces[].preview_id |
wrangler.jsonc |
Dev/preview KV namespace ID |
assets.directory |
wrangler.jsonc |
Output dir for the built React SPA |
- Cloudflare Workers Docs
- Cloudflare KV Docs
- Hono β Ultra-fast web framework for the Edge
@cloudflare/vite-pluginDocs- Wrangler CLI Reference