steam-watcher
A small Cloudflare Worker that watches the Steam games you’ve taken to 100% and
pings a Discord or Slack webhook when one of them drops back below 100%. In
practice that almost always means the developer shipped new achievements.
Why it exists: the completionist trackers (AStats, completionist.me, Steam
Hunters) will show you that a game fell off your perfect list, but none of them
actually tell you. You have to go look. This does the one thing they don’t, and
nothing else.
Design
It has no runtime dependencies. The whole thing runs on the Workers fetch
runtime.
Two cron triggers drive it, both on UTC. One runs hourly and re-checks the games
you already hold at 100%. The other runs weekly and rescans your full library to
pick up games you’ve newly finished.
The decision logic lives in src/core.ts and is pure, so it gets unit-tested
without spinning up the Workers runtime. All the I/O sits in src/index.ts.
One guard matters more than the rest: an ambiguous Steam lookup (a private
profile, a game with no achievements, an API error) is treated as a skip, never
as “lost 100%”. A regression only fires when the achievement count actually grew
and you’re now below 100%. That’s what keeps it from crying wolf.
src/core.ts pure domain logic (parse, detect, format), fully tested
src/index.ts Worker entry: cron handler, Steam API, KV, webhook
src/env.d.ts augments the generated Env with secret bindings
test/ node:test unit tests, no test framework
Prerequisites
- Node 22 or newer (for native TypeScript test execution)
- pnpm, via
corepack enable
- A Steam Web API key: https://steamcommunity.com/dev/apikey
- Your SteamID64, with Game details set to Public in your Steam privacy
settings. If it’s private, the achievements API returns nothing.
- A Cloudflare account and a Discord or Slack incoming webhook
Setup
corepack enable
pnpm install # generates pnpm-lock.yaml, commit it
# Configure Cloudflare resources
pnpm dlx wrangler kv namespace create WATCHER_STATE # paste id into wrangler.jsonc
# set STEAM_ID in wrangler.jsonc
# Secrets
pnpm dlx wrangler secret put STEAM_API_KEY
pnpm dlx wrangler secret put WEBHOOK_URL
Develop and test
pnpm test # run unit tests (node --test with TS type-stripping)
pnpm run typecheck # tsc --noEmit (run `pnpm run types` first to generate types)
# Trigger the scheduled handler locally:
pnpm dev # then, in another shell:
curl "http://localhost:8787/cdn-cgi/handler/scheduled?cron=0+*+*+*+*"
For local runs, copy .dev.vars.example to .dev.vars and fill it in.
Deploy
pnpm run deploy
CI deploys automatically on push to main via .github/workflows/deploy.yml.
Security
See SECURITY.md. Every GitHub Action is pinned to a commit SHA.
When you add a new one, resolve its SHA the same way with:
pnpm dlx pinact run
How it decides
A watched game has regressed when, on a re-check, both of these are true:
- its total achievement count is higher than the last recorded value, and
- your unlocked count is now lower than that total.
The stored total is refreshed on every check, so if the developer adds a second
wave of achievements later, that shows up as a new delta too.
Limitations
- Steam can take up to about a day to reflect newly added achievements. This
reads the same data, so polling hourly won’t beat that.
- It’s single-user, tied to your SteamID. Supporting more people would mean
per-user state keys.
- It tells you the count grew, not which achievements were added. If you want
their names, extend it with
GetSchemaForGame.
评论