MessageBird provider for AdonisJS.
Simply run:
adonis install adonis-messagebird
Add MessageBird provider to your AdonisJS application located at start/app.js
:
const providers = [
// ...
"adonis-messagebird/providers/MessageBirdProvider",
];
Add to your .env
file
MESSAGE_BIRD_KEY=
Simply call it using:
const MessageBird = use('MessageBird');
const util = require("util");
const MessageBird = use("MessageBird");
const sendSms = async () => {
const send = util.promisify(MessageBird.messages.create);
const message = await send({
originator: "+15017122661",
recipients: ["+15558675310"],
body: "This is the ship that made the Kessel Run in fourteen parsecs?",
});
console.log(message.id);
};
This is basically a wrapper over messagebird-nodejs.
For more information, kindly check out the MessageBird Official Documentation.
If you find any issue, bug or missing feature, please kindly create an issue or submit a pull request.
Adonis MessageBird is open-sourced software licensed under the MIT license.