@root-manas/hookloop
v0.2.2
Published
Replay controlled webhook sequences against loopback endpoints and assert final application state.
Maintainers
Readme
hookloop
Replay webhook deliveries against a local receiver and check its final state. A 200 response alone does not prove that duplicate deliveries were handled safely.
Requires Node.js 22+. Install with npm i -D @root-manas/hookloop, or use npx @root-manas/hookloop.
Try it
npx @root-manas/hookloop --init webhook-check
node webhook-check/server.mjsIn a second terminal:
npx @root-manas/hookloop --config webhook-check/config.json --format humanThe starter sends one event three times and another once. Its state assertion expects two unique events. Point the config at your own local receiver:
{
"url": "http://127.0.0.1:49181/events",
"events": [
{ "body": { "id": "event-1" }, "repeat": 3 },
{ "body": { "id": "event-2" } }
],
"state": {
"url": "http://127.0.0.1:49181/state",
"assertions": [{ "pointer": "/uniqueEvents", "equals": 2 }]
}
}Events run in order. The optional state check reads JSON and compares JSON Pointer values. A state check with no assertions cannot pass. Use --format json for automation. Exit codes: 0 for no errors, 1 for failed checks, 2 for invalid input or execution errors.
hookloop sends real POST requests. Use disposable test data. It accepts loopback URLs only, rejects redirects, and does not simulate concurrent delivery. Optional HMAC signing is raw SHA-256; check that it matches your provider's scheme.
