Socket
Socket
Sign inDemoInstall

termii-nodejs

Package Overview
Dependencies
1
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    termii-nodejs

NodeJS package (SDK) for Termii API


Version published
Weekly downloads
59
decreased by-21.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Termii NodeJS SDK

forthebadge forthebadge

Termii

npm version GitHub version

Installation

You can install the package via npm:

npm i termii-nodejs

Usage:

Loading and configuring the module

const Termii = require("termii-nodejs").Termii;

Creating an Instance of the SDK:

const sender_id = "YOUR_SENDER_ID";
const api_key = "YOUR_API_KEY";

const termii = new Termii({
	api_key: api_key,
	sender_id: sender_id,
});

Basic Usage

const request = termii.getBalance().then((res) => console.log(res));

There you go! 🍭

Documentation

👉🏿 Refer to the official Termii Docs

APIs

This is a list of methods available in this SDK according to the official APIs

Insights API

  • getBalance()
  • search(phone_number)
  • getStatus(phone_number, country_code)
  • getHistory()

Messaging API

  • sendMessage(recipient, message)

Number API

  • sendMessageWithAutomatedNumber(recipient, message)

Token API

  • inAppToken(phone_number)
  • sendToken(phone_number, pin_placeholder, message_text)
  • sendVoiceToken(phone_number)
  • sendVoiceCall(phone_number, code)
  • verifyToken(pin_id, pin)

Sender ID API

  • getSenderId()
  • requestSenderId(sender_id, usecase, company)

Templates API

  • sendTemplate(phone_number, device_id, template_id, data)

Campaign API

Not Yet Available.

Advanced Usage

Options

You can have full control when you create a new instance of the Termii class.

Not all options are needed for every request, refer to the Docs and see what is required for the resources you need.

new Termii({
	api_key: api_key,
	sender_id: sender_id,
	channel: "generic",
	pin_attempts: 2,
	pin_time: 1,
	pin_length: 6,
	pin_type: "NUMERIC"
});
  • channel : Route through which the message is sent. It is either dnd, WhatsApp, or generic.
  • pin_time : Validity of pin before expiration in minutes and default is 1.
  • pin_length : Length of the PIN code. Default is 4.
  • pin_attempts : Nnumber of times the PIN can be attempted.
  • pin_type : NUMERIC or ALPHANUMERIC

License

MIT

Keywords

FAQs

Last updated on 04 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc