bởi Kade

Add scalable, real-time chat to web and mobile apps with minimal effort. Supports open channels, group channels, file messages, and secure token-based authentication.
This block packages the Sendbird Chat SDK (@sendbird/chat@4.22.2) for drop-in use in JavaScript and TypeScript projects. It provides real-time messaging, group channels, open channels, feed channels, and AI agent integrations. The typical buyer is a web or Node.js developer who wants to embed production-grade chat without building from scratch.
.github/ - CI workflow for documentation update notificationscjs/ - CommonJS build artifacts (.cjs bundles) for Node.js environmentslib/ - ESM bundle chunks used by the top-level entry pointsCHANGELOG.md - Version history for the v4 stable seriesCHANGELOG_V4_BETA.md - Version history for v4 beta releasesLICENSE.md - Sendbird proprietary license termsREADME.md - Official quick-start and browser support referenceaiAgent.d.ts / aiAgent.js - AI agent channel types and exportscatalog-info.yaml - Internal Sendbird service catalog metadatafeedChannel.d.ts / feedChannel.js - Feed channel module entrygroupChannel.d.ts / groupChannel.js - Group channel module entryindex.d.ts / index.js - Primary ESM entry point with core SDK exportmessage.d.ts / message.js - Message type definitions and helpersnode.d.ts / node.js - Node.js-specific SDK entry pointopenChannel.d.ts / openChannel.js - Open channel module entrypackage.json - Package manifest with exports mappoll.d.ts / poll.js - Poll feature module entrysendbird.min.js - Minified browser-ready bundle (CDN / script tag use)npm install @sendbird/chat@4.22.2
No native modules, pod installs, or Android linking are required. The SDK is pure JavaScript and works in any modern browser or Node.js 16+ environment without additional build steps.
Copy the directory into your project, e.g. .
Khởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Tetrees AI Review cho phiên bản này
This JavaScript cli / script completed archive review with strong static results. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Quy trình avcp-2026-08-04.1 · SHA-256 d4573138d0887219…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Đã đánh giá 4 thg 8, 2026
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
Chưa có đánh giá.
Sign in to join the discussion
Loading discussion…
source/vendor/sendbird-chat-sdk/In tsconfig.json, add a path alias so TypeScript resolves the local copy instead of the registry package:
{
"compilerOptions": {
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"paths": {
"@sendbird/chat": ["./vendor/sendbird-chat-sdk/index.d.ts"],
"@sendbird/chat/groupChannel": ["./vendor/sendbird-chat-sdk/groupChannel.d.ts"],
"@sendbird/chat/openChannel": ["./vendor/sendbird-chat-sdk/openChannel.d.ts"],
"@sendbird/chat/message": ["./vendor/sendbird-chat-sdk/message.d.ts"],
"@sendbird/chat/feedChannel": ["./vendor/sendbird-chat-sdk/feedChannel.d.ts"],
"@sendbird/chat/poll": ["./vendor/sendbird-chat-sdk/poll.d.ts"],
"@sendbird/chat/aiAgent": ["./vendor/sendbird-chat-sdk/aiAgent.d.ts"]
}
}
}
// vite.config.ts
import { defineConfig } from 'vite';
import path from 'path';
export default defineConfig({
resolve: {
alias: {
'@sendbird/chat': path.resolve(__dirname, 'vendor/sendbird-chat-sdk/index.js'),
},
},
});
// alias in jest.config.js or via module-alias
const moduleAlias = require('module-alias');
moduleAlias.addAlias('@sendbird/chat', './vendor/sendbird-chat-sdk/cjs/index.cjs');
SENDBIRD_APP_ID=your-app-id-here
Based on the package exports map and entry files:
index.js)import SendbirdChat from '@sendbird/chat';
import { GroupChannelModule } from '@sendbird/chat/groupChannel';
const sb = SendbirdChat.init({
appId: string;
modules: BaseModule[];
localCacheEnabled?: boolean;
logLevel?: LogLevel;
});
The root factory. Call SendbirdChat.init() once per application lifetime with your App ID and the feature modules you need. The returned instance is a singleton; subsequent calls to init() return the same instance.
groupChannel.js)import { GroupChannelModule } from '@sendbird/chat/groupChannel';
// Pass to SendbirdChat.init:
modules: [new GroupChannelModule()]
Enables group channel functionality on the SDK instance: creating channels, inviting members, sending messages, and receiving real-time events via channel handlers. Include this module whenever your app needs private or multi-user conversations.
openChannel.js)import { OpenChannelModule } from '@sendbird/chat/openChannel';
modules: [new OpenChannelModule()]
Enables open channel functionality (public, large-scale, broadcast-style chat rooms). Use this module for live streaming chat, community feeds, or any context where anonymous or mass participation is required.
Initialize Sendbird with group channel support, connect an authenticated user, and verify the connection.
import SendbirdChat from '@sendbird/chat';
import { GroupChannelModule } from '@sendbird/chat/groupChannel';
const sb = SendbirdChat.init({
appId: process.env.SENDBIRD_APP_ID!,
modules: [new GroupChannelModule()],
localCacheEnabled: true,
});
async function connectUser(userId: string, accessToken?: string) {
const user = await sb.connect(userId, accessToken);
console.log('Connected as:', user.userId, user.nickname);
return user;
}
connectUser('user-001', 'optional-access-token');
Create a private group channel between two users, then send a user message into it.
import SendbirdChat from '@sendbird/chat';
import { GroupChannelModule, GroupChannelCreateParams } from '@sendbird/chat/groupChannel';
import { UserMessageCreateParams } from '@sendbird/chat/message';
const sb = SendbirdChat.init({
appId: process.env.SENDBIRD_APP_ID!,
modules: [new GroupChannelModule()],
});
async function createAndSend(myUserId: string, peerId: string) {
await sb.connect(myUserId);
const params: GroupChannelCreateParams = {
invitedUserIds: [peerId],
isDistinct: true,
};
const channel = await sb.groupChannel.createChannel(params);
console.log('Channel URL:', channel.url);
const msgParams: UserMessageCreateParams = {
message: 'Hello from Sendbird!',
};
const pendingMsg = channel.sendUserMessage(msgParams, (message, error) => {
if (error) console.error('Send error:', error);
else console.log('Sent:', message.messageId, message.message);
});
return pendingMsg;
}
Register a channel handler to receive incoming messages and member events without polling.
import SendbirdChat from '@sendbird/chat';
import {
GroupChannelModule,
GroupChannelHandler,
} from '@sendbird/chat/groupChannel';
import type { BaseMessage, BaseChannel } from '@sendbird/chat/message';
const sb = SendbirdChat.init({
appId: process.env.SENDBIRD_APP_ID!,
modules: [new GroupChannelModule()],
});
async function listenForMessages(userId: string) {
await sb.connect(userId);
const handler: GroupChannelHandler = {
onMessageReceived(channel: BaseChannel, message: BaseMessage) {
console.log(`[${channel.url}] New message:`, message);
},
onChannelChanged(channel: BaseChannel) {
console.log('Channel updated:', channel.url);
},
};
const handlerId = 'MY_HANDLER';
sb.groupChannel.addGroupChannelHandler(handlerId, handler);
// To clean up:
// sb.groupChannel.removeGroupChannelHandler(handlerId);
}
listenForMessages('user-001');
index.js / index.d.ts - Primary ESM entry; exports the SendbirdChat default and core types. Start here for all SDK access.groupChannel.js / groupChannel.d.ts - GroupChannelModule, GroupChannelHandler, query classes, and all group-channel-specific types.openChannel.js / openChannel.d.ts - OpenChannelModule and open-channel-specific APIs for public broadcast-style rooms.feedChannel.js / feedChannel.d.ts - FeedChannelModule for notification feed channels (one-way message delivery).message.js / message.d.ts - Message payload types (UserMessage, FileMessage, AdminMessage) and create-param interfaces.poll.js / poll.d.ts - Poll creation, voting, and event types for interactive message polls.aiAgent.js / aiAgent.d.ts - AI agent channel module for bot-driven conversation flows.node.js / node.d.ts - Node.js-optimized entry that swaps browser APIs for Node equivalents (WebSocket, FormData).sendbird.min.js - Self-contained minified bundle for direct <script> tag inclusion; exposes SendbirdChat on window.cjs/ - CommonJS equivalents of every entry point (.cjs extension) for use in Jest, server-side rendering, or non-bundled Node.lib/ - Internal ESM chunk files; not intended for direct import.package.json - Contains the exports map that resolves subpath imports (@sendbird/chat/groupChannel, etc.).allowSyntheticDefaultImports missing - If TypeScript complains about the default import, set "allowSyntheticDefaultImports": true in compilerOptions.require('@sendbird/chat') and import in the same build can create two SDK instances; pick one format and enforce it via bundler config.SendbirdChat.init() called multiple times - The SDK is a singleton; calling init() again in hot-module-reload environments resets state. Guard with a module-level flag.window / localStorage; on Node.js always import from @sendbird/chat/node (alias node.js) to avoid reference errors.init() - Calling sb.groupChannel without passing new GroupChannelModule() to init() throws at runtime. Every feature module must be registered upfront.exports field in package.json need explicit aliases for each subpath (@sendbird/chat/groupChannel → groupChannel.js).I have the Sendbird Chat SDK source located at `./vendor/sendbird-chat-sdk/`
and a usage guide at `./USAGE.md`. The upstream package is `@sendbird/chat@4.22.2`.
Please integrate this SDK into my existing [Node.js / React / Express] project step by step:
1. Read `USAGE.md` in full before writing any code.
2. Set up tsconfig paths and/or bundler aliases so imports like
`@sendbird/chat` and `@sendbird/chat/groupChannel` resolve to the local source.
3. Create an `src/lib/sendbird.ts` singleton that calls `SendbirdChat.init()`
with my App ID from `process.env.SENDBIRD_APP_ID` and registers the
GroupChannelModule and OpenChannelModule.
4. Add a `connectUser(userId: string, token?: string)` helper and a
`disconnectUser()` helper.
5. Add a `sendTextMessage(channelUrl: string, text: string)` function.
6. Wire a GroupChannelHandler that logs incoming messages to the console.
7. Do not install `@sendbird/chat` from npm; use only the local source.
8. Show me all new and modified files with full content.
The Sendbird Chat SDK is distributed under the Sendbird proprietary license. See source/LICENSE.md for the full terms. This block wraps the upstream package without modification.
Upstream: @sendbird/chat by Sendbird.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
Miễn phí