Skip to content

webigorkiev/ts-smsc

Repository files navigation

ts-smsc

ts-smsc is a library smsc.ru for node.js

Documentations

https://webigorkiev.github.io/ts-smsc/

Installation

npm i ts-smsc

Usage

import {smsc} from "ts-smsc";

const sender = smsc({
    
    // smsc.ConfigureOptions
    login: SMSC_LOGIN,
    password: SMSC_PASSWORD
});

// Send sms
sender.send({
   phones: "+38093100xxxx",
   mes: "Test text"
});

// Or send call code
sender.send({
    phones: "+38093100xxxx",
    mes: "Test text",
    call: 1
});

Async Usage

import {smsc} from "ts-smsc";

const sender = smsc({
    
    // smsc.ConfigureOptions
    login: SMSC_LOGIN,
    password: SMSC_PASSWORD
});

(async() => {
    
    // Send call code
    const {data, err, code} = await sender.send({
        phones: "+38093100xxxx",
        mes: "code",
        call: 1
    });
})();

Source

https://smsc.ru/api/