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

# verifyWebhook

> Verify a delivery's Standard Webhooks signature and timestamp; rejects with `WebhookVerificationError`. Does not deduplicate: store seen `id` values yourself.

```ts theme={null}
verifyWebhook(rawBody: string | Uint8Array, headers: WebhookHeaders, secret: string | readonly string[], options?: VerifyWebhookOptions): Promise<VerifiedWebhook>
```

## Example

```ts theme={null}
import { verifyWebhook } from "@endstate-sdk/core/webhooks";

const rawBody = await request.text();
const { id } = await verifyWebhook(rawBody, request.headers, process.env.WEBHOOK_SECRET!);
```

Verify the body exactly as received; a re-serialized JSON body never matches. Pass an array of secrets while a rotation is in progress. Deliveries are at-least-once, so record the `id` values you have handled; the SDK does not deduplicate.


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