> ## Documentation Index
> Fetch the complete documentation index at: https://nestcrate.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# nestrs-webhooks API

> Reference for WebhooksModule, WebhooksService, Standard Webhooks sign/verify, and outbox dispatch.

Crate: [`nestrs-webhooks`](https://docs.rs/nestrs-webhooks/1.7.1) · Feature: `webhooks` · Guide: [Webhooks](https://nestcrate.dev/ecosystem/webhooks.md)

```toml theme={null}
nestrs-webhooks = "1.7.1"
```

## `WebhooksModule::register`

```rust theme={null}
WebhooksModule::register(WebhooksOptions::new("whsec_…"))
```

Exports `WebhooksService`. Optional `WebhooksOptions.outbox: Option<Arc<OutboxRelay>>`.

## `WebhooksService`

```rust theme={null}
pub fn new(secret: impl Into<String>, outbox: Option<Arc<OutboxRelay>>) -> Self
pub fn sign(&self, msg_id: &str, timestamp: i64, body: &[u8]) -> SignedWebhook
pub fn verify(&self, msg_id: &str, timestamp: &str, signature: &str, body: &[u8])
    -> Result<(), WebhookVerifyError>
pub async fn dispatch(&self, topic: &str, url: &str, body: Value) -> Result<(), String>
```

## Free functions

```rust theme={null}
pub fn sign_standard_webhook(secret: &str, msg_id: &str, timestamp: i64, body: &[u8]) -> SignedWebhook
pub fn verify_standard_webhook(...) -> Result<(), WebhookVerifyError>
```

`WebhookVerifyError`: `BadTimestamp` · `BadSignature`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.