@codebucket/whatsapp
Version:
A reusable WhatsApp Business API client with template and non-template support, webhook handling, pluggable storage, and text sanitization
19 lines (18 loc) • 679 B
TypeScript
import { SendMessageOptions, WebhookPayload, MessageStore, TemplateVariables } from './types';
export type WhatsAppSendOptions = (TemplateSendOptions & {
templateName: string;
}) | SendMessageOptions;
export interface TemplateSendOptions {
senderUserId: string;
businessAccountId: string;
accessToken: string;
to: string;
templateName: string;
language?: string;
variables: TemplateVariables;
}
export declare function sendWhatsApp(opts: WhatsAppSendOptions, store: MessageStore): Promise<{
response: any;
warnings?: string[];
}>;
export declare function handleWhatsAppWebhook(payload: WebhookPayload, store: MessageStore): Promise<void>;