KV Notes
Simple note storage with Workers KV at the edge
Store and retrieve small text notes using a dedicated Workers KV namespace.
API Reference
POST /notes
Create or update a note.
Prop
Type
Example Request
curl -X POST "https://your-worker.workers.dev/notes" \
-H "Content-Type: application/json" \
-d '{"id":"todo-1","content":"Ship the experiment"}'Success Response
{
"id": "todo-1",
"content": "Ship the experiment",
"updatedAt": "2025-06-20T12:00:00.000Z"
}GET /notes
Fetch a note by id.
id string (required)
Example Request
curl "https://your-worker.workers.dev/notes?id=todo-1"DELETE /notes
Delete a note by id.
id string (required)
Error Codes
400- Invalid id or content (INVALID_ID,INVALID_CONTENT,INVALID_BODY)404- Note not found (NOT_FOUND)
Use Cases
- Learn KV read/write/delete patterns without D1
- Store small configuration blobs at the edge
- Prototype simple key-value APIs before adding auth
Limitations
- Note IDs are capped at 64 characters; content at 4,000 characters
- No authentication; any client can read, write, or delete by ID
- KV is eventually consistent across edge locations
Deployment
Configure KV
Create a KV namespace and bind it as NOTES in wrangler.json.
Local Development
cd apps/experiments/kv-notes
npm install
npm run devCloudflare Features Used
- Workers - Edge compute runtime
- Workers KV - Global key-value storage