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 factory.

Client instantiation looks as follows:

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

or, using async/await syntax:

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

Example above is minimal. Most likely you will want to control token lifecycle as well with Access Manager.

Consuming a library

You can consume the library from NPM:

npm install twilio-chat

For browser you can use the version from CDN:

<script src="//"></script>