watchline
v0.2.0
Published
Tiny serverless uptime and page-change monitor for Cloudflare Workers.
Maintainers
Readme
Watchline
Tiny serverless uptime and page-change monitoring for Cloudflare Workers.
Watchline is built for small projects, solo builders, and teams that want a cheap open source monitor without running a VM. It checks whether a URL is up, whether page text changed, or whether a specific JSON/regex field changed.
What ships in v0.1.0
- TypeScript monitoring core
- Local CLI:
watchline check <url> - Cloudflare Worker API and compact UI
- Cloudflare D1 schema
- Single cron-driven scheduler
- Webhook notifications for changed/down/recovered events
- GitHub Actions CI and npm release workflow
Install
npm install -g watchlinewatchline check https://example.com
watchline check https://api.example.com/status --json-pointer /status
watchline check https://example.com/pricing --regex "Price: (\\d+)" --group 1Deploy on Cloudflare
Create a D1 database:
npx wrangler d1 create watchlineCopy the returned database id into wrangler.toml, then apply the schema:
npx wrangler d1 migrations apply watchline --remoteDeploy:
npm run build
npm run deploySet an admin token for write actions:
npx wrangler secret put WATCHLINE_ADMIN_TOKENFor email notifications through Resend:
npx wrangler secret put RESEND_API_KEY
npx wrangler secret put WATCHLINE_EMAIL_FROMWATCHLINE_EMAIL_FROM should use a sender verified in Resend, for example Watchline <[email protected]>.
Notifications
Watchline sends notifications through a generic webhook URL and/or Resend email configured per monitor. Webhooks work with Slack incoming webhooks, Discord webhooks, n8n, Make, Zapier, or any HTTP endpoint that accepts JSON.
From the UI, paste the webhook URL in the Webhook URL field or an email address in the Email field when creating a monitor.
From the API:
curl -X POST https://your-worker.example.com/api/monitors \
-H "content-type: application/json" \
-H "x-watchline-token: $WATCHLINE_ADMIN_TOKEN" \
-d '{
"name": "Docs",
"url": "https://example.com/docs",
"mode": "page",
"intervalMinutes": 60,
"webhookUrl": "https://hooks.slack.com/services/...",
"notificationEmail": "[email protected]"
}'Notifications are sent when:
- a page or tracked field changes;
- a monitor goes down for the first time;
- a monitor recovers after being down.
The webhook body includes text for Slack, content for Discord, plus a structured JSON payload with the monitor, event, result, and diff summary.
API
curl https://your-worker.example.com/api/monitorscurl -X POST https://your-worker.example.com/api/monitors \
-H "content-type: application/json" \
-H "x-watchline-token: $WATCHLINE_ADMIN_TOKEN" \
-d '{
"name": "Docs",
"url": "https://example.com/docs",
"mode": "page",
"intervalMinutes": 60,
"webhookUrl": "https://hooks.slack.com/services/..."
}'Monitor modes
uptime: checks HTTP health and response time.page: strips noisy HTML and compares normalized text hashes.field: tracks one extracted value with JSON Pointer or regex.
Why this exists
Uptime tools are great for down/up checks. Page-change tools are powerful but often heavier than needed. Watchline aims for the thin middle: a small serverless monitor that costs almost nothing for small workloads, with room for JavaScript rendering and AI summaries later.
Release
The repo uses Changesets. CI checks type safety, tests, and build output. The release workflow publishes to npm when NPM_TOKEN is configured in GitHub repository secrets.
For user-facing changes, run npm run changeset before merging the feature PR.
Local release checks:
npm run ci
npm run release:dry-runLicense
MIT
