Function: constructEvent()
function constructEvent<T>(payload: string, opts: ConstructEventOptions): Promise<WebhookEvent<T>>;
Defined in: packages/sdk/src/webhook.ts:91
Verify and parse an inbound webhook into a typed event (Stripe-style).
Throws WebhookVerificationError on a bad signature, stale timestamp, or
unparseable body. payload must be the raw request body string.
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
payload | string |
opts | ConstructEventOptions |
Returns
Promise<WebhookEvent<T>>