Twilio Conversations client library

Twilio Conversations: Create meaningful connections with customers across channels.. Visit our official site for more detalis: https://www.twilio.com/conversations

Instantiating and using

To use the library you need to generate a token and pass it to the conversations Client create factory.

NPM

npm install --save @twilio/conversations

Using this method, you can require twilio-conversations and then use the client:

const Conversations = require('twilio-conversations');
Conversations.Client.create(token).then(client => {
    // Use client
});

or, if you prefer async/await syntax:

const Conversations = require('twilio-conversations');
let client = await Conversations.Client.create(token);
// Use client

CDN

Releases of twilio-conversations.js are hosted on a CDN, and you can include these directly in your web app using a <script> tag.

<script src="https://media.twiliocdn.com/sdk/js/conversations/v0.1/twilio-conversations.min.js"></script>

Using this method, twilio-conversations.js will set a browser global Twilio.Conversations through which you can use the client :

Twilio.Conversations.Client.create(token).then(client => {
    // Use client
});

or, if you prefer async/await syntax:

let client = await Twilio.Conversations.Client.create(token);
// Use client

Supported Browsers

BrowserSupported Versions
Chrome for Android84
Firefox for Android79
UC Browser for Android12.12
Chrome85, 84, 83
Edge84, 83, 81
Firefox80, 79, 78
Internet Explorer11
Safari for iOS13.4-13.5, 13.3
Safari13.1, 13, 12.1
Samsung Internet12.0, 11.1-11.2

Changelog

See this link.