@replyke/express
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
21 lines (20 loc) • 857 B
TypeScript
/**
* Generate an HMAC signature for a given payload and timestamp.
*/
export declare function generateHmacSignature(payload: any, timestamp: number, secret: string): string;
/**
* Validate an HMAC signature.
*/
export declare function validateHmacSignature(payload: any, signature: string, secret: string): boolean;
/**
* Send a webhook request to the given URL with the specified data and headers.
*/
export declare function sendWebhookRequest(webhookUrl: string, payload: any, secret: string): Promise<any>;
/**
* Send a webhook request to the given URL with the specified data and headers.
*/
export declare function sendWebhookRequestWithHandle(webhookUrl: string, payload: any, secret: string): Promise<any>;
/**
* Handle errors during webhook requests.
*/
export declare function handleWebhookError(err: any, defaultMessage: string): void;