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 | Package Name |
Lite Edition | 200 KB | Initialization and event listening. Login and logout. Supports sending and receiving text messages. Supports custom message sending and receiving (customizable content). Supports user profile and user status. | @tencentcloud/lite-chat/basic |
Standard Edition (Default) | 516 KB | Includes all features of the Lite Edition, plus: Supports retrieving historical messages, message operations, merged forwarding, read receipts, message extension, and more. Supports sending and receiving image, video, audio, and file messages. Supports cloud message (Message) search, user (User) search, group (Group) search, and group member search. Supports conversation list, conversation profile, and conversation operations. Supports group management and group member management. Supports community. Supports AVChatRoom. | @tencentcloud/lite-chat |
Professional Edition | 609 KB | Includes all features of the Standard Edition, plus: Supports blacklist, friend management, friend grouping. Supports following and followers. Supports conversation grouping. Supports topics. | @tencentcloud/lite-chat/professional |
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
