npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

termii-nodejs-sdk

v1.0.2

Published

Node js SDK for the Termii messages (SMS) and one time password (OTP) services

Downloads

70

Readme

termii-nodejs-sdk

Node js SDK for the Termii messages (SMS) and one time password (OTP) services

Introduction

These docs will give you a deep dive into Termii Nodejs SDK full API Reference Documentation and how to seamlessly integrate Termii messaging channels and verification functionalities into NodeJS application. For more details about the Termii services

Installation

Use need NodeJS or yarn package manager to use this SDK with your nodejs application. Note: all the instance return promise.

npm install termii-nodejs-sdk

or

yarn add termii-nodejs-sdk

Get your api key

create an account at termii.com.

  • login to your account

  • click on the setting

  • click on the API Token

  • copy your API Key

  • the image bellow can guid you more termii API console!

Basic

#
import Termii from "termii-nodejs-sdk"

#es5
const Termii = require("termii-nodejs-sdk").default

#usage 
const termii = new Termii("your API Key")

#Get your account balance 
let balance = termii.balance(); #balance will return a promise
balance.then(data=>{
    console.log(JSON.stringify({data}))
})

#Or
termii.balance().then(data=>{console.log({data})}).catch(err=>{console.log({err})})

#Or
 (async () => {
     balance = await termii.balance();
     console.log(JSON.stringify({balance}))
 })()
 
 # Request for A token 
 termii.token({
    message_type: "NUMERIC",
    to: "2348037.........",
    from: "Token",
    channel: "generic",
    pin_attempts: 4,
    pin_time_to_live: 4,
    pin_length: 6,
    pin_placeholder: "< 123456 >",
    message_text: "Your (company name) confirmation code is < 123456 >. It expires in 30 minutes",
    "pin_type":"NUMERIC"
}).then(dat=>console.log({dat})).catch(er=>console.log({er}));

Available Services

 #
import Termii from "termii-nodejs-sdk"

#es5
const Termii = require("termii-nodejs-sdk").default

#usage 
const termii = new Termii("your API Key")

termii.getSenderId() Get all the your available sender id

termii.requestSenderId({sender_id,usecase,company}) Request for a new sender Id

termii.sendSMS({to,from,sms,type,channel,media}) Send SMS

termii.bulkSMS({to,from,sms,type,channel}) Send bulk SMS

termii.message({to,sms}) Send message | Number API

termii.template({phone_number,device_id,template_id,data:{product_name,opt,expiry_time}}) Template

termii.phoneBook() Get phone book

termii.createPhoneBook({phonebook_id,phonebook_name,description}) create phone book

termii.updatePhoneBook({phonebook_id,phonebook_name,description}) update phone book

termii.deletePhoneBook({phonebook_id}) Delete phone book

termii.contact({phonebook_id}) get all the contact

termii.addContact({phonebook_id,phone_number,country_code,email_address,first_name,last_name,company}) Add contact

termii.addBulkContact({phonebook_id,contact_file,country_code}) Add bulk Contact

termii.deleteContact({contact_id}) delete contact

termii.campaign({country_code,sender_id,message,channel,message_type,phonebook_id,campaign_type,schedule_sms_status,schedule_time}) Campaign

termii.campaignList() Campaign List

termii.campaignHistory({campaign_id}) Campaign Hostory

termii.token({message_type,to,from,channel,pin_attempts,pin_time_to_live,pin_length,pin_placeholder,message_text}) Token | OTP

termii.voiceToken({pin_type,phone_number,pin_attempts,pin_time_to_live,pin_length}) Voice Token

termii.callToken({phone_number,code}) call token | OTP

termii.inAppToken({pin_type,phone_number,pin_attempts,pin_time_to_live,pin_length}) In App Token

termii.verifyToken({pin_id,pin}) Verify Token

termii.balance() get account balance

termii.search({phone_number}) search

termii.status({ phone_number:", country_code:"}) status

termii.history() history

Report issues here 💔

Termii nodejs SDK issue

Documentation

Termi services

Todo

  • Create more sample to consume all the services
  • create more details in the documentation
  • add more validation to the payload and response
  • write an article about the services

Contact Me

[Abduljeleel Yusuff]mailto:[email protected]