Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

@cmdotcom/text-sdk

0.2.0 • Public • Published

@cmdotcom/text-sdk: A helper library to send text messages.

Published on NPM Travis (.com) Codecov Codacy grade

Want to send text-messages in your Node.js application? Then you are at the right place.

The package is currently limited in features compared to the CM gateway, but if you want to get all the functionalities, go to: CM.com API Docs

Usage

Node.JS

First, run npm install @cmdotcom/text-sdk. Then, in your source file:

const messagingApi = require("@cmdotcom/text-sdk");
 
// Get your product token at CM.com.
const yourProductToken = "";
const myMessageApi = new messagingApi.MessageApiClient(yourProductToken);
 
const result = myMessageApi.SendTextMessage("00316012345678", "TestSender", "Hello world?!");
 
result.then((result) => {
    console.log(result);
}).catch((error) => {
    console.log(error);
});

or send multiple with SendTextMessages:

const result = myMessageApi.SendTextMessages(["00316012345678","003160000000"], "TestSender", "Hello world?!");

License

@cmdotcom/text-sdk is under the MIT license. See LICENSE file.

install

npm i @cmdotcom/text-sdk

Downloadsweekly downloads

38

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability