npm install @appstitch/twilio
npm install @appstitch/core
npm install @appstitch/types
import { sendMessage, makeCall } from "@appstitch/twilio";
// OR
import * as twilioClient from "@appstitch/twilio";
This library mirror Twilio's API. You can use or our JSDocs for reference.
twilioClient.sendMessage({
from: "+1234567890",
to: "+10987654321",
body: "My First Twilio Message",
}).then(message => console.log(message.sid));
})
twilioClient.makeCall({
from: "+1234567890",
to: "+10987654321",
url: "http://demo.twilio.com/docs/voice.xml",
}).then(call => console.log(call.sid));
})
}