23 lines
800 B
TypeScript
23 lines
800 B
TypeScript
/// <reference types="node" />
|
|
/// <reference types="node" />
|
|
export { WebhookVerificationError } from "standardwebhooks";
|
|
export interface WebhookRequiredHeaders {
|
|
"svix-id": string;
|
|
"svix-timestamp": string;
|
|
"svix-signature": string;
|
|
}
|
|
export interface WebhookUnbrandedRequiredHeaders {
|
|
"webhook-id": string;
|
|
"webhook-timestamp": string;
|
|
"webhook-signature": string;
|
|
}
|
|
export interface WebhookOptions {
|
|
format?: "raw";
|
|
}
|
|
export declare class Webhook {
|
|
private readonly inner;
|
|
constructor(secret: string | Uint8Array, options?: WebhookOptions);
|
|
verify(payload: string | Buffer, headers_: WebhookRequiredHeaders | WebhookUnbrandedRequiredHeaders | Record<string, string>): unknown;
|
|
sign(msgId: string, timestamp: Date, payload: string | Buffer): string;
|
|
}
|