New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

termii-nodejs-client

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

termii-nodejs-client

Nodejs SDK wrapper for Termii API written with Typescript support

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Termii Node SDK

npm (scoped) npm Twitter Follow

Nodejs SDK for Termii messaging platform written in typescript

Table of content

Prerequisite

Node v16 and higher is required. To make sure you have them available on your machine, try running the following command.

 node -v

Getting Started

To get started with this SDK, create an account on Termii if you haven't already. You can then retrieve your API keys from your Termii dashboard.

Installation

This SDK can be installed with npm or yarn or pnpm.

# using npm
npm install termii-nodejs-client
# using yarn
yarn install termii-nodejs-client
# using pnpm
pnpm add termii-nodejs-client

Usage

Import and Initialize the library

// use modules
import { Termii } from 'termii-nodejs-client';
// use cjs
const {Termii} = require('termii-nodejs-client')

const termii = new Termii('YOUR_API_KEY');

Instantiate the Termii class

const termii = new Termii('YOUR_API_KEY');

Warning Be sure to keep your API Credentials securely in environment variables.

Documentation

Available Services exposed by the SDK

Sender ID

A Sender ID is the name or number that identifies the sender of an SMS message.

Fetch Sender ID
// returns the first 15 sender ids
const senderIds = await termii.message.fetchSenderIDs()

// to get the next page of sender ids 
const senderIds = await termii.message.fetchSenderIDs(2)

Find more details about the parameters and response for the above method here

Create Sender ID
// import the request sender id interface from the sdk
import { type IRequestSenderID } from 'termii-nodejs-client';

const message: IRequestSenderID = {
    sender_id: 'acme',
    usecase: 'Testing! Working!! This is it!!!',
    company: 'Metalabs',
}

const senderIds = await termii.message.requestSenderID(payload)

Find more details about the parameters and response for the above method here

Message

This API allows businesses send text messages to their customers across different messaging channels.

Send message
// import the request sender id interface from the sdk
import { type ISendMessage } from 'termii-nodejs-client';

const message: ISendMessage = {
     to: "2347880234567",
     from: "talert",
     sms: "Hi there, testing Termii",
     type: "plain",
     channel: "generic",
     api_key: "Your API Key",
     media: {
      url: "https://media.example.com/file",
      caption: "your media file"
  }    
}

const senderIds = await termii.message.sendMessage(payload)

Find more details about the parameters and response for the above method here

Send Bulk message
// import the request sender id interface from the sdk
import { type ISendMessage } from 'termii-nodejs-client';

const message: ISendMessage = {
     to: ["23490555546", "23423490126999","23490555546"],
     from: "talert",
     sms: "Hi there, testing Termii",
     type: "plain",
     channel: "generic"
}

const senderIds = await termii.message.sendBulkMessage(payload)

Find more details about the parameters and response for the above method here

License

MIT

Keywords

FAQs

Package last updated on 09 Nov 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc