adonis-messagebird

1.0.1 • Public • Published

Adonis MessageBird 🦜

MessageBird provider for AdonisJS.

Installation

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=

Usage

Simply call it using:

const MessageBird = use('MessageBird');

Examples

Sending SMS

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);
};

Official Documentation

This is basically a wrapper over messagebird-nodejs.

For more information, kindly check out the MessageBird Official Documentation.

Contributing

If you find any issue, bug or missing feature, please kindly create an issue or submit a pull request.

License

Adonis MessageBird is open-sourced software licensed under the MIT license.

/adonis-messagebird/

    Package Sidebar

    Install

    npm i adonis-messagebird

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.2 kB

    Total Files

    6

    Last publish

    Collaborators

    • tnkemdilim