Step 1: Install Chat SDK
Overview
This guide provides step-by-step instructions for integrating the TRTC Chat SDK V4 (
@tencentcloud/lite-chat) into your web application.V3 User Upgrade Notice:
Version Overview
Edition | Size | Feature Overview |
Basic Edition | 200 KB | Initialization and event listening. Login and logout. Supports sending and receiving text messages. Supports sending and receiving custom messages (customizable content). Supports User Profile and user status. |
Standard Edition (default) | 516 KB | Includes all Basic Edition features, plus: Supports retrieving historical messages, message operations, merged forwarding, read receipts, Message Extension, and more. Supports sending and receiving images, video, audio, and file messages. Supports searching Cloud messages (Message), users (User), groups (Group), and group members. Supports conversation list, conversation profile, and conversation operations. Supports Group Management and group member management. Supports Community. Supports AVChatRoom. |
Professional Edition | 609 KB | Includes all Standard Edition features, plus: Supports blacklist, friend management, and friend grouping. Supports follow and fan features. Supports conversation grouping. Supports topics. |
npm Integration
Install the required dependency in your project using npm.
npm install @tencentcloud/lite-chat
// If you experience issues syncing dependencies, try switching the npm registry and run againnpm config set registry http://r.cnpmjs.org/
Importing the SDK
The V4 SDK lets you import the Basic Edition, Standard Edition, or Professional Edition according to your application's needs for optimal bundle size.
// Standard Edition (default import, recommended)import TencentCloudChat from '@tencentcloud/lite-chat';// Basic Edition (core chat and user management, smallest bundle size)// import TencentCloudChat from '@tencentcloud/lite-chat/basic';// Professional Edition (includes social features such as friend relationship chain)// import TencentCloudChat from '@tencentcloud/lite-chat/professional';
Related Resources
SDK APIs