https://github.com/codewithveek/termii-js
A Javascript SDK for Termii SMS & OTP
https://github.com/codewithveek/termii-js
Last synced: 7 days ago
JSON representation
A Javascript SDK for Termii SMS & OTP
- Host: GitHub
- URL: https://github.com/codewithveek/termii-js
- Owner: codewithveek
- License: mit
- Created: 2022-12-12T12:49:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-13T13:37:12.000Z (over 3 years ago)
- Last Synced: 2026-02-04T14:37:18.583Z (4 months ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# termii-simple
A Javascript SDK for [Termii](https://termii.com) SMS & OTP(Email,SMS,WhatsApp).
## Installation
`npm i termii-simple` or `yarn add termii-simple`;
## Usage
> Each method supports both promises and callbacks.
You can find your Api Key on your [Termii dashboard](https://accounts.termii.com/#/)
```js
// ES6 Module
import { TermiiClient } from 'termii-simple'
// commonjs
const { TermiClient }=require('termii-simple');
const client=new TermiiClient({
apiKey:" your termii Api key"
});
// for SMS
const smsClient=new client.TermiiSMS();
const result= await smsClient.send({
to:"234701234567",
from:"Sender ID",
sms:"Hi, this is a test SMS",
channel:"generic",
})
console.log(result.data)
// for OTP
const otpClient=new client.TermiiOTP();
otpClient.generate({
pin_type:"NUMERIC",
phone_number:"2347012345678"
},(result,error)=>{
console.log(result.data);
})
```