Twilio Chat client library

Twilio Chat is a service for messages delivery over ip networks. Visit our official site for more detalis:

Instantiating and using

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


npm install --save twilio-chat

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

const Chat = require('twilio-chat');
Chat.Client.create(token).then(client => {
    // Use client

Or, if you prefer async/await syntax:

const Chat = require('twilio-chat');
const client = await Chat.Client.create(token);
// Use client

The SDK could also be imported using the ES module syntax:

import Chat from 'twilio-chat';
const client = await Chat.Client.create(token);
// Use client


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

<script src=""></script>

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

Twilio.Chat.Client.create(token).then(client => {
    // Use client

or, if you prefer async/await syntax:

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

Supported Browsers

BrowserSupported Versions
Chrome for Android91
Firefox for Android89
UC Browser for Android12.12
Chrome91, 90, 89
Edge91, 90, 89
Firefox89, 88, 87
Internet Explorer11
Safari for iOS14.5-14.6, 14.0-14.4
Safari14.1, 14, 13.1
Samsung Internet14.0, 13.0


See this link.