JavaScript chat libraries

Updated Nov 2026

JavaScript chat libraries connect an app to a messaging service that stores conversations and delivers new messages in real time. Most of them are client SDKs for a hosted service that also issues the user tokens. These libraries add direct messages, group channels, and support chat to marketplaces, communities, and customer apps.

Popularity

Stream Chat has the most monthly downloads in this comparison, at 3.3M.

LibraryMonthly downloadsStarsLast releaseLicense
Stream Chat
3.3M
211Nov 2026Stream proprietary SDK license
matrix-js-sdk
1.9M
2.2KNov 2026Apache-2.0
@aws-sdk/client-chime-sdk-messaging
1.4M
3.7KNov 2026Apache-2.0
Ably Chat
1.2M
23Nov 2026Apache-2.0
Sendbird Chat
906.3K
32Nov 2026Sendbird SDK license
Twilio Conversations
875.6K
Not on GitHubSep 2026MIT
Azure Communication Chat
223.5K
2.3KJun 2025MIT
TalkJS
223.4K
Not on GitHubMay 2026TalkJS proprietary license
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryLive message subscriptionsBundled conversation UIOSI-approved SDK license
Stream ChatBuilt-inVia pluginUnsupported
matrix-js-sdkBuilt-inUnsupportedBuilt-in
@aws-sdk/client-chime-sdk-messagingVia pluginUnsupportedBuilt-in
Ably ChatBuilt-inVia pluginBuilt-in
Sendbird ChatBuilt-inVia pluginUnsupported
Twilio ConversationsBuilt-inUnsupportedBuilt-in
Azure Communication ChatBuilt-inVia pluginBuilt-in
TalkJSBuilt-inBuilt-inUnsupported
Built-inVia pluginNot supported

Libraries and code examples

Stream Chat

Connects frontend or backend applications to the Stream Chat service.

Downloads / mo
3.3M
Stars
211
Last release
10.1.0
License
Stream proprietary SDK license

Strengths

  • Accepts a renewing token provider. Supply a token provider to refresh authentication after expiry.
  • Supports external attachment storage. Upload attachments to Stream's CDN or a separate CDN.

Limitations

  • User tokens need a server. Generate signed user tokens on the app's server, where the secret stays.
  • Privacy settings suppress read events. Disabled read-receipt sharing hides read status from other users.

Quickstart

From init-and-users
$ npm install stream-chat
import { StreamChat } from "stream-chat";

const client = StreamChat.getInstance("{{ api_key }}");
// you can still use new StreamChat("api_key");

await client.connectUser(
  {
    id: "jlahey",
    name: "Jim Lahey",
    image: "https://i.imgur.com/fR9Jz14.png",
  },
  "{{ chat_user_token }}",
);

Provides a Matrix client for JavaScript and TypeScript chat applications.

Downloads / mo
1.9M
Stars
2.2K
Last release
45.1.0
License
Apache-2.0

Strengths

  • Supports end-to-end encryption. Initialize the Rust crypto backend to enable encrypted chat.
  • Loads earlier room messages. Use scrollback to add older messages to a room timeline.

Limitations

  • Encryption needs explicit initialization. Call initRustCrypto before using the client’s encryption APIs.
  • Temporary crypto storage changes devices. Without persistent storage, create a new device each application start.

Quickstart

From README.md
$ pnpm add matrix-js-sdk
import * as sdk from "matrix-js-sdk";
const client = sdk.createClient({ baseUrl: "https://matrix.org" });
const rooms = await client.publicRooms({ limit: 10 });

matrix-js-sdk examples

From open-source projects on GitHub

@aws-sdk/client-chime-sdk-messaging

Sends and receives messages in custom messaging apps through the Amazon Chime SDK messaging APIs.

Downloads / mo
1.4M
Stars
3.7K
Last release
3.1171.0
License
Apache-2.0

Limitations

  • Depends on the identity APIs. Set up users through the Amazon Chime SDK identity APIs before sending messages.

Quickstart

From README.md
$ npm install @aws-sdk/client-chime-sdk-messaging
import { ChimeSDKMessagingClient, ListChannelFlowsCommand } from "@aws-sdk/client-chime-sdk-messaging";
const client = new ChimeSDKMessagingClient({ region: "REGION" });
const data = await client.send(new ListChannelFlowsCommand({ AppInstanceArn: "APP_INSTANCE_ARN" }));

Ably Chat

Provides chat room APIs built on Ably's realtime platform.

Downloads / mo
1.2M
Stars
23
Last release
2.0.0
License
Apache-2.0

Limitations

  • Built for person-to-person chat. Conversations with an AI agent use Ably AI Transport, a separate product.

Quickstart

From README.md
$ npm install @ably/pubsub-device @ably/chat
import { createClient } from '@ably/pubsub-device';
import { createChatClient, RoomStatus, RoomStatusChange } from '@ably/chat';

// Initialize Ably Pub/Sub Realtime client
// Note: For client-side applications, token authentication is recommended.
// See: https://ably.com/docs/auth
const pubsubClient = createClient({
  key: '<your-ably-api-key>',
  clientId: 'your-client-id',
});

// Create a chat client
const chatClient = createChatClient(pubsubClient);

// Get a chat room
const room = await chatClient.rooms.get('my-room');

// Monitor room status
room.onStatusChange((statusChange: RoomStatusChange) => {
  switch (statusChange.current) {
    case RoomStatus.Attached:
      console.log('Room is attached');
      break;
    case RoomStatus.Detached:
      console.log('Room is detached');
      break;
    case RoomStatus.Failed:
      console.log('Room failed:', statusChange.error);
      break;
    default:
      console.log('Room status:', statusChange.current);
  }
});

// Subscribe to messages
const subscription = room.messages.subscribe((event) => {
  console.log('Received message:', event.message.text);
});

// Attach to the room
await room.attach();

// Send a message
await room.messages.send({ text: 'Hello, World!' });

Adds real-time chat through Sendbird open channels or group channels.

Downloads / mo
906.3K
Stars
32
Last release
4.22.16
License
Sendbird SDK license

Strengths

  • Provides open and group channels. Choose an open channel or group channel for the conversation.
  • Reports group typing status. Receive typing updates from other members of a group channel.

Limitations

  • Initialize required channel modules. Import channel modules and provide them during SDK initialization.
  • New-member history depends on settings. Configure chat history before new members need older messages.

Quickstart

From README.md
$ npm install @sendbird/chat
import SendbirdChat from "@sendbird/chat";
import { OpenChannelModule } from "@sendbird/chat/openChannel";

const sb = SendbirdChat.init({
  appId: APP_ID,
  modules: [new OpenChannelModule()],
});


// The USER_ID below should be unique to your Sendbird application.
try {
  const user = await sb.connect(USER_ID);
  // The user is connected to Sendbird server.
} catch (err) {
  // Handle error.
}

Sendbird Chat examples

From open-source projects on GitHub

Twilio Conversations

Provides the JavaScript client for Twilio Conversations classic.

Downloads / mo
875.6K
Last release
3.0.1
License
MIT

Strengths

  • Paginates conversation history. Retrieve messages through the built-in paginator interface.
  • Sends media attachments. Send media messages within a conversation.

Limitations

  • Read status needs application updates. Update the read horizon when the user views messages.
  • Message indexes contain gaps. Compare indexes without treating their difference as a message count.

Quickstart

From index.html
$ npm install --save @twilio/conversations
import { Client } from '@twilio/conversations';

const client = new Client(token);

// Before you use the client, subscribe to the `'initialized'` event.
client.on('initialized', () => {
  // Use the client.
});

// To catch client initialization errors, subscribe to the `'initFailed'` event.
client.on('initFailed', ({ error }) => {
  // Handle the error.
});

Twilio Conversations examples

From open-source projects on GitHub

Azure Communication Chat

Sends messages between users in chat threads on Azure Communication Services.

Downloads / mo
223.5K
Stars
2.3K
Last release
1.6.0
License
MIT

Strengths

  • Joins Teams meetings. Chat clients can join Microsoft Teams meetings and exchange Teams chat messages.

Quickstart

From README.md
$ npm install @azure/communication-chat @azure/communication-common
import { AzureCommunicationTokenCredential } from "@azure/communication-common";
import { ChatClient } from "@azure/communication-chat";

// Your unique Azure Communication service endpoint
const endpointUrl = "<ENDPOINT>";
const userAccessToken = "<USER_ACCESS_TOKEN>";
const tokenCredential = new AzureCommunicationTokenCredential(userAccessToken);
const chatClient = new ChatClient(endpointUrl, tokenCredential);

const createChatThreadRequest = {
  topic: "Hello, World!",
};

const createChatThreadOptions = {
  participants: [
    {
      id: { communicationUserId: "<USER_ID>" },
      displayName: "<USER_DISPLAY_NAME>",
    },
  ],
};

const createChatThreadResult = await chatClient.createChatThread(
  createChatThreadRequest,
  createChatThreadOptions,
);

const threadId = createChatThreadResult?.chatThread?.id;

TalkJS

Provides a chat API with a pre-built, customizable chat UI.

Downloads / mo
223.4K
Last release
0.46.0
License
TalkJS proprietary license

Limitations

  • Browser package only. React Native apps use the separate @talkjs/react-native package.

Quickstart

From README.md
$ npm install talkjs
import Talk from "talkjs";
await Talk.ready;
const session = new Talk.Session({ appId: "<APP_ID>", userId: "sample_user_alice" });
const chatbox = session.createChatbox();
chatbox.select("<CONVERSATION_ID>");
chatbox.mount(document.getElementById("talkjs-container"));

FAQ

Stream Chat, Sendbird Chat, Ably Chat, and TalkJS connect to hosted chat services, and TalkJS also ships a pre-built chat UI. Matrix JS SDK connects to the open Matrix protocol under an open source license.

Both are hosted chat services with proprietary SDK licenses and optional UI kits. Stream accepts a token provider that refreshes authentication, while Sendbird separates conversations into open channels and group channels.

Stream Chat and Ably Chat follow the same hosted chat model, and TalkJS adds a pre-built UI. Matrix JS SDK connects to the open Matrix protocol instead of one vendor's service.

The Twilio Conversations client takes an access token that a backend issues, then loads conversations and pages through their messages. Conversations can include chat, SMS, MMS, and WhatsApp participants.

Stream’s SDK is an API client for its service. Sendbird initialization requires an application ID from its dashboard. Twilio requires a token passed to the client constructor.

Tokens are signed with the API secret and created on the server. A client initialized with only the API key cannot mint a token.

For coding agents

Found your chat library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official