Interface WebhookContext

Raw webhook context passed to provider verification.

Encapsulates everything a provider needs to verify a webhook's authenticity and parse its payload, without coupling to any specific HTTP framework (Express, Fastify, Koa, etc.).

interface WebhookContext {
    method: string;
    url: string;
    headers: Record<string, undefined | string | string[]>;
    body: string | Buffer<ArrayBufferLike>;
    parsedBody?: Record<string, string>;
}

Properties

method: string

HTTP method (usually POST).

url: string

Full request URL (used for signature verification).

headers: Record<string, undefined | string | string[]>

HTTP headers.

body: string | Buffer<ArrayBufferLike>

Raw request body (string or Buffer).

parsedBody?: Record<string, string>

Parsed body (for providers that need form-encoded data).