1.0.0 • Published 3 years ago
textng v1.0.0
Textng Node.js Library
The Textng Node library provides convenient access to the Textng API from applications written in server-side JavaScript.
Documentation
See the Textng
API docs.Written in PHP Language
Requirements
Node 8, 10 or higher.
Installation
Install the package with:
npm install textng --save
# or
yarn add textng
Usage
The package needs to be configured with your account's secret key.This could be found at the bottom of your Account Profile page. The key authorizes the transaction.
const textng = new Textng({
key: "xxxxxxxxx",
sender:"yyyyyyyyy"
})
textng.sendSMS({
phone: "0800000000",
message:"hello world"
})
.then(textng => console.log(textng))
.catch(error => console.error(error));
Or using ES modules and async
/await
:
import Textng from 'textng';
const textng = new Textng({
key: "xxxxxxxxx",
sender:"yyyyyyyyy"
})
(async () => {
const textng = await textng.sendSMS({
email: "0800000000",
message:"hello world"
});
console.log(textng);
})();
1.0.0
3 years ago