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

# signWebhook

> Returns the hex HMAC-SHA-256 of a raw body under a shared secret.

```ts theme={null}
function signWebhook(secret, body): Promise<string>;
```

Returns the hex HMAC-SHA-256 of a raw body under a shared secret.

## Parameters

### secret

`string`

### body

`string`

## Returns

`Promise`\<`string`>

## Remarks

This is the value `sendEvent` sends as `X-Tappify-Signature`, computed over the
exact bytes of the body it posts. Call it directly only when you build the
request yourself, and sign the serialised string you send rather than
re-serialising the object, because a different key order is a different
signature. Uses Web Crypto, so it runs on Node, Cloudflare Workers and Vercel
alike.

## Example

```ts theme={null}
import { signWebhook } from '@tappify/extension-sdk/server';

async function signed(body: string): Promise<Record<string, string>> {
  return { 'x-tappify-signature': await signWebhook('whsec_test', body) };
}
```
