0.1.0 âĸ Published 2 years ago
@kernet/smsportal v0.1.0
âšī¸ī¸ Description
This TypeScript library simplifies interaction with the SMSPortal API for sending SMS messages. It provides a convenient class, SmsPortal, that handles the API authentication and sending of SMS messages, making it easy to integrate SMS functionality into your TypeScript or JavaScript applications.
đ§ How to Install
Install using npm:
npm install @kernet/smsportalInstall using yarn:
yarn add @kernet/smsportalInstall using pnpm:
pnpm add @kernet/smsportalđ¨đģâđĢ How to Use
Get full details
import { SmsPortal, SmsMessage , ApiResponse } from "@kernet/smsportal";
const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';
const smsClient = new SmsPortal(apiKey, apiSecret);
const messages: SmsMessage[] = [{ content: 'Hello SMS World from NodeJS', destination: phone }]
// ApiResponse is Implicit
smsClient.sendSMS(message)
.then((response: ApiResponse) => {
console.log("Success:");
console.log(response);
})
.catch(error => {
console.log("Failure:");
console.error(error.message);
});đđģ Contributing
This is an open source project. Any contribution would be greatly appreciated!
Rename .env.example to .env and add your keys. This project uses pnpm.