NotificationWebhooks

Webhooks

Verify and normalise inbound provider delivery-status webhooks

Webhooks

Verify the signature of inbound provider webhooks and normalise them to the NotificationEvent shape. All verifiers use Web Crypto (globalThis.crypto.subtle), so they run on Cloudflare Workers and other edge runtimes.

import { twilioVerifier, slackVerifier, standardWebhookVerifier, snsVerifier } from "@visulima/notification/webhooks";

// Slack (v0 signing): HMAC-SHA256 of `v0:{timestamp}:{body}` with a 5-minute replay window
const ok = await slackVerifier.verify(rawBody, request.headers, signingSecret);

if (ok) {
    const event = slackVerifier.parse(rawBody); // -> NotificationEvent | undefined
}

Available verifiers

VerifierScheme
twilioVerifierX-Twilio-Signature — base64 HMAC-SHA1 of URL + sorted params.
slackVerifierv0 signing — hex HMAC-SHA256 of v0:{ts}:{body} + replay window.
standardWebhookVerifierStandard Webhooks HMAC-SHA256.
snsVerifierSNS envelope + subscription-confirmation handling.

Each exposes verify(payload, headers, secret) => Promise<boolean> and parse(body) => NotificationEvent | undefined.

SNS full RSA certificate-chain verification is a documented TODO; the verifier handles envelope/type parsing and subscription confirmation today.

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues