Skip to main content

Todoist to Cloudflare KV

A Cloudflare Worker that receives Todoist webhook events and stores task data in Cloudflare KV. It handles task creation, updates, completion, and deletion events, maintaining a synchronized copy of Todoist tasks in KV storage.

Supported Events

EventAction
item:addedCreates a new KV entry with task data
item:updatedUpdates the existing KV entry
item:completedMarks the task as completed with timestamp
item:deletedRemoves the KV entry

KV Data Structure

Each task is stored with the Todoist ID as the key:

{
"url": "https://todoist.com/showTask?id=123456",
"taskName": "My Task",
"taskDescription": "Task description",
"dueDate": "2024-12-31",
"dueTime": "14:00",
"dueTimezone": "Asia/Tokyo",
"durationUnit": "minute",
"durationAmount": 30,
"todoistId": "123456"
}

Completed tasks include additional fields: completed: true and completedAt with an ISO timestamp.

Tech Stack

ComponentTechnology
RuntimeCloudflare Workers
StorageCloudflare KV
LanguageTypeScript

Security

Webhook requests are validated using the X-Todoist-Webhook-Secret header against the configured TODOIST_WEBHOOK_SECRET.