# stream-chat

> JS SDK for the Stream Chat API

Latest version **9.54.0** (published 2026-10-05) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install stream-chat
pnpm add stream-chat
yarn add stream-chat
bun add stream-chat
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.54.0 |
| Published | 2026-10-05 |
| First published | 2019-01-30 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 9 |
| Unpacked size | 8.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 209 |
| Author | GetStream.io, Inc. |
| Maintainers | tbarbugli, tschellenbach, vishtree, stream-release-bot, vangalilea88, zita.szupera, caleb.murphy, martincupela, link512 |
| Keywords | chat, messaging, conversation, react, stream, getstream, getstream.io |

## Links

- npm: https://www.npmjs.com/package/stream-chat
- Repository: https://github.com/GetStream/stream-chat-js
- Homepage: https://getstream.io/chat/
- Issues: https://github.com/GetStream/stream-chat-js/issues
- npm.io page: https://npm.io/package/stream-chat

## Dependencies (9)

- [ws](https://npm.io/package/ws.md) ^8.20.1
- [axios](https://npm.io/package/axios.md) ^1.19.0
- [@types/ws](https://npm.io/package/@types/ws.md) ^8.18.1
- [base64-js](https://npm.io/package/base64-js.md) ^1.5.1
- [form-data](https://npm.io/package/form-data.md) ^4.0.6
- [linkifyjs](https://npm.io/package/linkifyjs.md) ^4.3.3
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.3
- [isomorphic-ws](https://npm.io/package/isomorphic-ws.md) ^5.0.0
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^9.0.8

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 9.54.0 (latest) — 2026-10-05
- 10.0.0-rc.22 (rc) — 2026-10-16
- 8.61.0 (release-v8) — 2026-07-02
- 9.2.0-offline-support-beta.3 (beta) — 2025-05-26
- 8.0.0-dev.0 (dev) — 2022-10-12
- 10.0.0-rc.21 — 2026-10-09
- 10.0.0-rc.20 — 2026-10-09
- 10.0.0-rc.19 — 2026-10-06
- 10.0.0-rc.18 — 2026-10-05
- 10.0.0-rc.17 — 2026-10-01
- 10.0.0-rc.16 — 2026-09-30
- 10.0.0-rc.15 — 2026-09-25
- 10.0.0-rc.14 — 2026-09-24
- 10.0.0-rc.13 — 2026-09-23
- 10.0.0-rc.12 — 2026-09-18
- … 451 more at https://npm.io/package/stream-chat/versions

## README

# Official JavaScript SDK for [Stream Chat](https://getstream.io/chat/)

[![NPM](https://img.shields.io/npm/v/stream-chat.svg)](https://www.npmjs.com/package/stream-chat)

<p align="center">
    <img src="./assets/logo.svg" width="50%" height="50%">
</p>
<p align="center">
    Official JavaScript API client for Stream Chat, a service for building chat applications.
    <br />
    <a href="https://getstream.io/chat/docs/"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://github.com/GetStream/stream-chat-js/issues">Report Bug</a>
    ·
    <a href="https://github.com/GetStream/stream-chat-js/issues">Request Feature</a>
</p>

## 📝 About Stream

You can sign up for a Stream account at our [Get Started](https://getstream.io/chat/get_started/) page.

This library can be used by both frontend and backend applications. For frontend, we have frameworks that are based on this library such as the [Flutter](https://github.com/GetStream/stream-chat-flutter), [React](https://github.com/GetStream/stream-chat-react) and [Angular](https://github.com/GetStream/stream-chat-angular) SDKs. For more information, check out our [documentation](https://getstream.io/chat/docs/).

## ⚙️ Installation

### NPM

```bash
npm install stream-chat
```

### Yarn

```bash
yarn add stream-chat
```

## ✨ Getting Started

```ts
import { StreamChat } from 'stream-chat';
// or if you are using CommonJS
const { StreamChat } = require('stream-chat');

const client = new StreamChat('API_KEY', 'API_SECRET', {
  disableCache: true, // recommended option for server-side use
  // ...other options like `baseURL`...
});

// create a user
await client.upsertUser({
  id: 'vishal-1',
  name: 'Vishal',
});

// create a channel
const channel = client.channel('messaging', 'test-channel', {
  created_by_id: 'vishal-1',
});
await channel.create();

// send message
const { message } = await channel.sendMessage({ text: 'This is a test message' });

// send reaction
await channel.sendReaction(message.id, { type: 'love', user: { id: 'vishal-1' } });
```

The `StreamChat` client is set up to allow extension of the base types through use of module augmentation, custom types will carry through to all client returns and provide code-completion to queries (if supported). To extend Stream's entities with custom data you'll have to create a declaration file and make sure it's loaded by TypeScript, [see the list of extendable interfaces](https://github.com/GetStream/stream-chat-js/blob/master/src/custom_types.ts) and the example bellow using two of the most common ones:

```ts
// stream-custom-data.d.ts

import 'stream-chat';

declare module 'stream-chat' {
  interface CustomMessageData {
    custom_property?: number;
  }
  interface CustomUserData {
    profile_picture?: string;
  }
}

// index.ts

// property `profile_picture` is code-completed and expects type `string | undefined`
await client.partialUpdateUser({
  id: 'vishal-1',
  set: { profile_picture: 'https://random.picture/1.jpg' },
});

// property `custom_property` is code-completed and expects type `number | undefined`
const { message } = await channel.sendMessage({
  text: 'This is another test message',
  custom_property: 255,
});

message.custom_property; // in the response object as well
```

> [!WARNING]  
> Generics mechanism has been removed in version `9.0.0` in favour of the module augmentation, please see [the release guide](https://getstream.io/chat/docs/node/upgrade-stream-chat-to-v9) on how to migrate.

## 🔗 (Optional) Development Setup in Combination With Our SDKs

### Connect to [Stream Chat React Native SDK](https://github.com/GetStream/stream-chat-react-native)

Run in the root of this repository:

```sh
yarn link
```

Run in the root of one of the example applications (SampleApp/TypeScriptMessaging) in the `stream-chat-react-native` repository:

```sh
yarn link stream-chat
yarn start
```

Open `metro.config.js` file and set value for `watchFolders` as:

```js
const streamChatRoot = '<PATH TO YOUR PROJECT>/stream-chat-js'

module.exports = {
  // the rest of the metro configuration goes here
  ...
  watchFolders: [projectRoot].concat(alternateRoots).concat([streamChatRoot]),
  resolver: {
    // the other resolver configurations go here
    ...
    extraNodeModules: {
      // the other extra node modules go here
      ...
      'stream-chat': streamChatRoot
    }
  }
};
```

Make sure to replace `<PATH TO YOUR PROJECT>` with the correct path for the `stream-chat-js` folder as per your directory structure.

Run in the root of this repository:

```sh
yarn start
```

## 📚 More Code Examples

Read up more on [Logging](./docs/logging.md), [User Token](./docs/userToken.md), and [Webhooks](./docs/webhooks.md) (including compressed payloads and SQS / SNS delivery) or visit our [documentation](https://getstream.io/chat/docs/) for more examples.

## ✍️ Contributing

We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our [license file](./LICENSE) for more details.

Head over to [CONTRIBUTING.md](./CONTRIBUTING.md) for some development tips.

## 🧑‍💻 We Are Hiring!

We've recently closed a [$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing.
Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.

Check out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).

---
_Source: https://npm.io/package/stream-chat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
