@kernet/smsportal
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

SMSPORTAL

ℹ️️ 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/smsportal

Install using yarn:

yarn add @kernet/smsportal

Install 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.

Readme

Keywords

none

Package Sidebar

Install

npm i @kernet/smsportal

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

9.22 kB

Total Files

7

Last publish

Collaborators

  • applicafropkg