Verifies the HMAC signature on every FastComments webhook delivery and stores what arrives in SQLite.
Live: https://fastcomments-webhooks.val.run
Remix it, hit Send test event, and watch a signed delivery verify and land. Then point a real webhook at your copy.
FastComments signs ${timestamp}.${body} with your account's API secret and sends:
X-FastComments-Timestamp: 1789004710 unix SECONDS, not millis
X-FastComments-Signature: sha256=<hex>
Methods carry the event: PUT for a created or updated comment, DELETE for a deleted one.
Verify the raw bytes. verify.ts hashes the exact body string that arrived. Calling c.req.json()
and re-serializing changes key order and whitespace, so the hash differs and every delivery fails with no
obvious cause. This is the usual reason a webhook receiver "just doesn't work".
Compare in constant time. A plain === on the signature leaks how many bytes matched, which is enough
to forge one byte at a time. verify.ts uses timingSafeEqual.
It also rejects deliveries whose timestamp is outside a five minute window, so a captured request cannot be replayed later.
| File | What it does |
|---|---|
config.ts | The API secret, and the replay window |
verify.ts | Signature verification, and the signer used by the test button |
db.ts | SQLite storage |
main.tsx | Routes |
Dashboard.tsx | The event table |
- Get your API secret from your account. Free 30 day trial, then plans from $0.99/mo.
- Add FASTCOMMENTS_API_SECRET here: https://www.val.town/x/fastcomments/webhook-receiver/environment-variables?key=FASTCOMMENTS_API_SECRET
- Add a webhook in your FastComments dashboard pointing at your val's URL.
Unset, the secret falls back to the public demo tenant's, which is what makes the test button work with
no setup. The signature check is real, but a secret everyone knows verifies nothing. Set your own
before pointing a real webhook here. The dashboard says so while the fallback is in use.
Every delivery is stored, retries included. There is deliberately no dedupe key: a comment id repeats
across create, edit and delete, and a retry is re-signed with a fresh timestamp, so nothing is stable to
dedupe on. Make your handler idempotent on comment_id rather than assuming each event arrives once.
Answer quickly. FastComments retries on a non-2xx, and an endpoint that keeps failing is eventually disabled automatically. Do real work after responding, not inline.
val.town/x/fastcomments/skills is a remixable library of FastComments agent skills. Townie and the Val Town MCP server pick them up once the remix is in your account.