Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

toksdotdev/adonis-twilio-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Adonis Twilio ๐Ÿš€

Twilio provider for AdonisJS.

Installation

Simply run:

adonis install adonis-twilio-node

Add twilio provider to your AdonisJS application located at start/app.js:

const providers = [
    ...
    'adonis-twilio/providers/TwilioProvider'
];

Add to your .env file

TWILIO_SID=
TWILIO_TOKEN=

Usage

Simply call it using:

const Twilio = use('Twilio');

Examples

Sending SMS

const Twilio = use('Twilio');

const sendSms = async () => {
    const message = await Twilio.messages.create({
        body: 'This is the ship that made the Kessel Run in fourteen parsecs?',
        from: '+15017122661',
        to: '+15558675310'
    });

  console.log(message.sid);
};

Official Documentation

This is basically a wrapper over twilio-node.

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

Contributing

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

License

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