webhookguard-elsolya
v0.1.0
Published
Webhook verification, replay protection, processing, and CLI tooling
Maintainers
Readme
webhookguard-elsolya
Webhook signature verification, replay protection, processing, and the webhook-toolkit CLI.
Install
npm install webhookguard-elsolyaUsage
import {
createWebhookVerifier,
hmacSha256Strategy,
createMemoryReplayStore,
} from "webhookguard-elsolya";
const verifier = createWebhookVerifier({
strategy: hmacSha256Strategy({ secret: process.env.WEBHOOK_SECRET!, tolerance: "5m" }),
replayStore: createMemoryReplayStore(),
eventId: (event) => event.id,
});
const verified = await verifier.verify({ headers, rawBody });CLI
npx webhook-toolkit generate-secret
npx webhook-toolkit sign --secret test --body ./payload.json
npx webhook-toolkit verify --secret test --body ./payload.json --signature "<sig>"License
MIT
