Simple Infobip outbound messaging library written in typescript
install the package
npm install infobip-sender
Example:
import { InfobipMessageService } from "infobip-sender";
const config = { apiKey: "YourApiKey" };
// Create an instance with your configuration
const messagingService = new InfobipMessageService(config);
//use sendSms() method to s end a single or bulk sms message
const smsMessage = await messagingService.sms.sendSMS(
"YourSenderNumberHere",
"RecipientPhoneNumber",
"Message"
);
const bulkSmsMessages = await messagingService.sms.sendSMS(
"YourSenderNumberHere",
["RecipientPhoneNumber1", "RecipientPhoneNumber2"],
"Message"
);
...
{
apiKey: string;
piIntegrator?: string;
piPlatform?: string;
baseUrl?: string;
notifyUrl?: string;
}
For more info refer to Infobip API Documentation
MIT