Skip to main content

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 ParameterDefault type
Tunknown

Parameters

ParameterType
payloadstring
optsConstructEventOptions

Returns

Promise<WebhookEvent<T>>