Registry / communication / sendbird

sendbird

JSON →
library3.1.33jsnpmunverified

The Sendbird Chat SDK v3 for JavaScript (current stable v3.1.33) facilitates the integration of real-time chat functionalities into client applications, abstracting the complexities of backend infrastructure. It enables core chat features such as user authentication, channel management (open and group channels), message sending and receiving, and event handling. This version is officially deprecated, with v3.1.33 being its final release in August 2023. Sendbird is actively transitioning users to its v4 SDK, which was first released in April 2022 and offers an extended feature set including enhanced WebSocket handling, improved local caching, polls, scheduled messages, and pinned messages. Developers are strongly encouraged to migrate to v4 due to the end of support and future bug fixes for v3.

npm install sendbird
INSTALL
IMPORT
SIG · SENDBIRD
S
sendbird
communicationjavascriptv3.1.33
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SendBird
import SendBird from 'sendbird'
import { SendBird } from 'sendbird'
The primary SendBird class is a default export in v3. It also acts as a namespace for many static methods and types.
UserMessageParams
import type { UserMessageParams } from 'sendbird'
Type imports are crucial for TypeScript projects, ensuring correct parameter definitions for message creation.
GroupChannel
import { GroupChannel } from 'sendbird'
const SendBird = require('sendbird'); const channel = new SendBird.GroupChannel();
While `SendBird` is a default export, certain classes and interfaces are available as named exports or accessed via the `SendBird` instance/namespace. The CommonJS `require` pattern is a common anti-pattern for modern JavaScript/TypeScript projects targeting v3 or later.

This quickstart demonstrates initializing the Sendbird SDK, connecting a user, entering an open channel, and sending a basic user message, including handling environment variables for credentials.

import SendBird from 'sendbird'; const APP_ID = process.env.SENDBIRD_APP_ID ?? 'YOUR_SENDBIRD_APP_ID'; const USER_ID = process.env.SENDBIRD_USER_ID ?? 'testuser123'; const NICKNAME = process.env.SENDBIRD_USER_NICKNAME ?? 'Test User'; const sb = new SendBird({ appId: APP_ID, modules: [new SendBird.ChannelModule(), new SendBird.MessageModule()] }); async function initializeAndConnect() { try { console.log('Connecting to Sendbird...'); const user = await sb.connect(USER_ID); console.log(`Connected as ${user.nickname} (${user.userId})`); // Create or get a channel const channelUrl = process.env.SENDBIRD_CHANNEL_URL ?? 'sendbird_open_channel_28653_373c38c116d90a78627e7f77a880949216065548'; const channel = await sb.OpenChannel.getChannel(channelUrl); await channel.enter(); console.log(`Entered channel: ${channel.name}`); // Send a message const messageText = `Hello from SDK v3! Current time: ${new Date().toLocaleTimeString()}`; const params = new sb.UserMessageParams(); params.message = messageText; const message = await channel.sendUserMessage(params); console.log('Message sent:', message.message); // Disconnect (optional, for cleanup) // await sb.disconnect(); // console.log('Disconnected from Sendbird.'); } catch (error) { console.error('Sendbird operation failed:', error); } } initializeAndConnect();
Debug
Known issues
breakingSendbird Chat SDK v3 is officially deprecated as of July 2023, with v3.1.33 being its final release in August 2023. No further updates, bug fixes, or security patches will be provided for this version. Users are strongly advised to migrate to Sendbird Chat SDK v4.
fix
Plan and execute migration to Sendbird Chat SDK v4. Refer to the official Sendbird documentation for migration guides and breaking changes.
affects: >=3.1.33
breakingMigration from Sendbird Chat SDK v3 to v4 involves significant breaking changes. The API surface, initialization patterns, and underlying architecture have evolved. Direct drop-in replacement is not possible.
fix
Consult the Sendbird Chat SDK v4 documentation and migration guides carefully. Prioritize testing and refactor code incrementally to adapt to the new API paradigms.
affects: >=3.0.0
gotchaOlder versions of Sendbird SDK v3 (prior to v3.1.32) could cause `sb.connect()` to fail in React Native environments due to an unexpected attempt to access the browser's `localStorage` API, which is unavailable in React Native.
fix
Update the `sendbird` package to v3.1.32 or higher. If sticking with an older version, ensure a `localStorage` polyfill is provided for the React Native environment, though upgrading is strongly recommended due to deprecation.
affects: <3.1.32
gotchaWhen `localCacheEnabled` was set to `false`, `MessageCollection` in SDK versions prior to v3.1.31 would incorrectly call `onMessagesUpdated()` with old messages upon connection or reconnection, leading to stale UI data.
fix
Update the `sendbird` package to v3.1.31 or higher. Review your `MessageCollection` event handlers to ensure they gracefully handle potential duplicate or out-of-order message updates if using older versions.
affects: <3.1.31
gotchaApplications targeting older browsers or environments that do not natively support `Promise.finally()` (e.g., Internet Explorer 11) would encounter runtime errors if using Sendbird SDK v3 versions prior to v3.1.24, as the SDK lacked an internal polyfill.
fix
Update the `sendbird` package to v3.1.24 or higher, which includes a Promise.finally() polyfill. Alternatively, ensure your build toolchain or application code provides a polyfill for `Promise.finally()` if targeting legacy environments.
affects: <3.1.24
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'localStorage')
The Sendbird SDK v3.1.31 or earlier attempted to access `localStorage` in a non-browser environment like React Native, where it is not available.
fix
Upgrade the `sendbird` package to v3.1.32 or later to resolve the `localStorage` access issue in React Native.
Uncaught (in promise) TypeError: Cannot read property 'finally' of undefined
The Sendbird SDK v3 was used in an environment (e.g., older browser) that lacks native `Promise.finally()` support, and no polyfill was provided.
fix
Update the `sendbird` package to v3.1.24 or higher, which bundles a `Promise.finally()` polyfill, or include a separate `Promise.finally()` polyfill in your application.
QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'sendbird_message_collection_key' exceeded the quota.
The Sendbird `MessageCollection` is attempting to store more data in `localStorage` than the browser's allocated quota allows.
fix
While v3.1.30 had stability improvements related to this, managing `localStorage` size is key. Consider reducing the number of messages cached, clearing old data, or migrating to SDK v4 which has more robust local caching strategies.
Error: channel.sendFileMessage() failed in web worker context
In Sendbird SDK v3 versions prior to v3.1.28, calling `channel.sendFileMessage()` within a Web Worker environment could lead to failures.
fix
Upgrade the `sendbird` package to v3.1.28 or later. If unable to upgrade, consider performing file message sending operations outside of Web Workers.
Upgrade
Version history
3.1.33latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources