UNPKG

@davidbolaji/termii-node

Version:

Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.

36 lines (35 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MessageService = void 0; class MessageService { constructor(http) { this.http = http; } /** * Send a single SMS or WhatsApp message * * @param payload - Request payload containing recipient, sender ID, and message details * @returns Expanded `SendMessageResponse` with message details */ async sendMessage(payload) { return this.http.request("/sms/send", { method: "POST", data: payload, authLocation: "body" }); } /** * Send bulk messages (up to 10,000 recipients) * * @param payload - Bulk message request payload * @returns Expanded `SendBulkMessageResponse` with bulk message status */ async sendBulkMessage(payload) { return this.http.request("/sms/send/bulk", { method: "POST", data: payload, authLocation: "body" }); } } exports.MessageService = MessageService;