OwlRelay Webhook utilities
npm install @owlrelay/webhookThis package contains the code to trigger and verify webhooks when an email is received.
``bash`
pnpm install @owlrelay/webhookor
npm install @owlrelay/webhookor
yarn add @owlrelay/webhook
To trigger a webhook, you can use the triggerWebhook function.`ts
import { triggerWebhook } from '@owlrelay/webhook';
await triggerWebhook({
email: { / .../},
webhookUrl: 'https://my-app.invalid/webhook',
webhookSecret: 'my-webhook-secret',
});
`
On the receiving end, you can verify the webhook by using the verifySignature function.
`ts
import { verifySignature } from '@owlrelay/webhook';
const isValid = verifySignature({
signature: 'my-signature',
bodyBuffer,
secret: 'my-webhook-secret',
});
``
This library is licensed under the AGPL-3.0 License. See the LICENSE file for details.
This project is crafted with ❤️ by Corentin Thomasset.
If you find this project helpful, please consider supporting my work.