Twilio

A secure client library for Twilio's APi

Install

npm install @appstitch/twilio

Install Peer Dependencies Appstitch Core and Appstitch Types

npm install @appstitch/core
npm install @appstitch/types

Remember Initialize Appstitch

Usage

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

Last updated

Was this helpful?