TypeScript SDK

Webhook.parse

Parses an incoming Universal Bridge webhook payload.

function parse(
payload: string,
headers: Record<string, string>,
secret: string,
tolerance: number,
): Promise<WebhookPayload>;

Parameters

The raw text body received from thirdweb.

Type

let payload: string;

The webhook headers received from thirdweb.

Type

let headers: Record<string, string>;

The webhook secret to verify the payload with.

Type

let secret: string;

The tolerance in seconds for the timestamp verification.

Type

let tolerance: number;

Returns

let returnType: Exclude<
z.infer<typeof webhookSchema>,
{ version: 1 }
>;