ms-phone
v3.1.1
Published
[![npm version](https://badge.fury.io/js/ms-phone.svg)](https://badge.fury.io/js/ms-phone) [![Build Status](https://semaphoreci.com/api/v1/makeomatic/ms-phone/branches/master/shields_badge.svg)](https://semaphoreci.com/makeomatic/ms-phone) [![codecov](htt
Downloads
84
Readme
Phone Microservice
Allows to interact with different communication providers through AMQP.
Providers
twilio
Account options
authToken
:twilio
AUTH_TOKEN
,from
:twilio
phone number,sid
:twilio
SID
,transportOptions
:twilio
library optionstype
: 'twilio',
Usage
API documentation.
const AMQP = require('@microfleet/transport-amqp');
const Phone = require('ms-mailer');
const phone = new Phone({
amqp: {
// ms-amqp-transport options
},
accounts: {
twilio_test: {
// twilio account options
}
}
});
const phoneService = phone.connect();
// e.g.
const amqp = AMQP.connect();
const message = {
account: 'twilio_test',
message: 'Hello!'
to: '+7 923 555 55 55'
};
amqp.publishAndWait('phone.message.predefined', message)
.then(response => {
// provider response
});