1.0.17 • Published 4 years ago
@appstitch/twilio v1.0.17
Appstitch Twilio
A flexible convenience wrapper for Twilio's API
Install
npm install @appstitch/twilio
Install Peer Dependancies Appstitch Core and Appstitch Types
npm install @appstitch/core
npm install @appstitch/types
Remember
Initialize Appstitch Core
Usage
There are 2 ways to clients
import { sendMessage, makeCall } from "@appstitch/twilio";
// OR
import * as twilioClient from "@appstitch/twilio";
This library mirror Twilio's API. You can use Twilio's Docs or our JSDocs for reference.
Send a message
twilioClient.sendMessage({
from: "+1234567890",
to: "+10987654321",
body: "My First Twilio Message",
}).then(message => console.log(message.sid));
})
Make a call
twilioClient.makeCall({
from: "+1234567890",
to: "+10987654321",
url: "http://demo.twilio.com/docs/voice.xml",
}).then(call => console.log(call.sid));
})
}
Reference Twilio's Docs and Appstitch Types to find out the attributes for each object/resource