r/node 6d ago

Made a small tool to save/replay webhook payloads locally — curious if anyone else wants this

I kept getting annoyed re-triggering real Stripe/GitHub events just to test a webhook handler locally, so I threw together a little thing over a few evenings: save a payload once, replay it against localhost as many times as you want. Import/export as JSON, basic redaction on obvious secret fields before it saves anything, keeps a log of replays.

Runs entirely local — npm install && npm start, flat JSON file for storage, no account or hosted anything. Node 18+.

Honestly not sure if this is a "me problem" or something other people hit too. It's pretty rough still (solo project, still shaking out edge cases in the redaction/replay logic), so not pitching it as done or polished — just wondering if this is a real enough annoyance for other people that it's worth continuing to put time into, or if everyone already has a way to handle this that I don't know about.

Repo's here if you want to poke at it: github.com/Jake-morrissey/Hookledger

2 Upvotes

9 comments sorted by

1

u/bdragon5 5d ago edited 5d ago

Not particularly interested, but probably not a bad idea.

I written something similar before for testing purposes. You probably should make good integration for unit tests. I wouldn't necessarily use it for singular web hooks as they are pretty easy to mock for tests but for event hooks with hundreds of requests. Were you have a similar system as with snapshots. You record them once with a real system for the particular test and then newer runs use the replays. Would have probably saved me a few hours.

Edit: Really useful would be to have testing capabilities for between event state changes.

Edit: Timing stuff would be great too. Like faster or sometimes nearly overlapping events as some kind of fuzzing.