https://github.com/makeomatic/ms-phone
https://github.com/makeomatic/ms-phone
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/makeomatic/ms-phone
- Owner: makeomatic
- Created: 2016-08-19T10:52:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-09-03T14:45:40.000Z (6 months ago)
- Last Synced: 2025-10-04T12:52:32.750Z (5 months ago)
- Language: JavaScript
- Size: 1020 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Phone Microservice
[](https://badge.fury.io/js/ms-phone)
[](https://semaphoreci.com/makeomatic/ms-phone)
[](https://codecov.io/gh/makeomatic/ms-phone)
Allows to interact with different communication providers through AMQP.
## Providers
### [twilio](https://www.twilio.com)
#### Account options
* `authToken`: `twilio` `AUTH_TOKEN`,
* `from`: `twilio` phone number,
* `sid`: `twilio` `SID`,
* `transportOptions`: `twilio` library options
* `type`: 'twilio',
## Usage
API [documentation](https://makeomatic.github.io/ms-phone/).
```js
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
});
```