0

Webhooks (signature + idempotency)

Integrationsused in ~68% of apps

A webhook is a public POST endpoint that a third party (Stripe, GitHub, Resend) calls when something happens in their system. Get the body-parsing wrong and every signature check fails; forget idempotency and a single retry double-charges, double-grants, or double-emails a real user. This is the integration that separates engineers who have shipped payments from those who have only read about them.

Core idea. Verify the RAW request body (await req.text()) against the provider's signature header before you trust a single byte — then treat every handler as IDEMPOTENT, because at-least-once delivery means replays will happen. Fulfill the business action on the verified webhook event, never on a browser redirect.
Playground, this isn't a screenshot
CRUD ↔ HTTP verb
POSTCreateGETReadPATCHUpdateDELETEDelete
local list (React state)2 items
#1Ship the feed
#2Review PRs
network — request / response
Add, edit, or delete an item. Watch the HTTP verb fire, then the local list update after the response.

Each mutation waits for the server's response, then updates the local list immutably (map / filter / spread) — no full refetch. Showing the change before the response is optimistic UI (#71).

↑ play a little first, then dig in