# Tencent RTC Chat — JavaScript > Chat documentation for JavaScript platform. ## Core SDK ### Getting Started - [Activate the Service](https://pre.trtc.io/document/74511.md): Tencent Cloud Chat service is an instant messaging SDK that enables developers to integrate messaging and group management features. This guide helps users activate the free plan, retrieve UserSig for authentication, purchase official editions, renew subscriptions, upgrade plans, and enable automatic renewal. It provides step-by-step instructions to quickly start using Chat and manage your application versions effectively. - [Run Demo](https://pre.trtc.io/document/66945.md): The JavaScript V4 Chat SDK is an npm package designed to seamlessly integrate chat capabilities into your applications across multiple frameworks such as Vue, React, and Angular. This quickstart guide covers essential steps including user authentication setup, SDK initialization, user login, message sending, avatar updates, and follower management. It supports multiple editions with varying features and works on major browsers, enabling developers to rapidly add flexible chat functionality using Tencent Cloud Chat API. - [Install Chat SDK](https://pre.trtc.io/document/34309.md): The TRTC Chat SDK V4 JavaScript SDK provides multiple editions tailored for web applications, including Lite, Standard, and Professional. This quickstart guide helps developers install the SDK via npm, import the appropriate edition for their needs, and initialize it to enable chat, messaging, user, group, and social features. Follow the step-by-step instructions to integrate the SDK efficiently into your web project. - [Initialize Chat SDK](https://pre.trtc.io/document/47967.md): The Tencent Cloud Chat SDK for JavaScript is a client SDK that enables developers to integrate instant messaging features into their applications. This guide explains how to initialize the Chat SDK by preparing an SDKAppID, calling the TencentCloudChat.create API, and setting up event listeners to handle SDK events. It also covers how to unregister event handlers and properly deinitialize the SDK. These steps ensure seamless messaging functionality and event management in your chat application. - [Login and Logout](https://pre.trtc.io/document/47970.md): The JavaScript Chat SDK provides APIs for user authentication, session management, and SDK state monitoring. It enables users to log in with UserID and UserSig, retrieve logged-in user information, check server time, and handle SDK readiness events. The SDK supports multi-instance login configuration and logout functionality to clear session data. This reference details key methods such as login, getLoginUser, getServerTime, isReady, and logout for developers integrating Tencent Cloud Chat features. ### Users - [User Profile](https://pre.trtc.io/document/48161.md): The JavaScript SDK of Tencent Cloud Chat provides APIs for managing user profiles, enabling users to retrieve and update their own profile information as well as query other users' profiles. Key APIs include getMyProfile for fetching personal profile data, getUserProfile for querying multiple users' profiles, and updateMyProfile for modifying profile attributes such as nickname, avatar, gender, and custom fields. These APIs support asynchronous operations using Promises and are designed to handle up to 100 user profiles per query. - [User Online Status](https://pre.trtc.io/document/49561.md): The JavaScript SDK offers User Status Management capabilities, allowing users to have both built-in normal statuses and customizable client-defined statuses. This SDK enables developers to set, query, and receive notifications about user statuses across multiple devices and platforms. It is designed for applications requiring real-time user presence and status updates, supporting features such as setting custom statuses like "Listening to music" or "During the call," and querying the status of oneself or others with appropriate permissions and edition upgrades. - [Friend Management](https://pre.trtc.io/document/48158.md): The JavaScript Chat SDK provides comprehensive friend management APIs for adding, deleting, and updating friends, as well as controlling message sending permissions between users. This SDK enables developers to implement friend relationship checks, retrieve friend lists, handle friend requests, and manage friend profiles efficiently. Key operations include adding friends with customizable remarks and groups, deleting friends with one-way or two-way options, and receiving events for friend list updates. These capabilities support building interactive chat applications with controlled user interactions. - [Friend List](https://pre.trtc.io/document/48155.md): The JavaScript SDK of Tencent Cloud Chat provides APIs for managing friend groups, including creating, deleting, renaming groups, retrieving friend group lists, and modifying group members. These APIs enable developers to organize friends into categorized groups such as classmates or coworkers, facilitating better social interactions within applications. Each API returns a Promise and triggers events to notify about updates to friend groups. - [Block List](https://pre.trtc.io/document/48152.md): The JavaScript Chat SDK for Tencent Cloud Chat provides APIs to manage user blocklists, allowing developers to block or unblock users and retrieve the current blocklist. This enables control over message reception by blocking specified users, with a maximum blocklist size of 1000. The SDK also supports event notifications when the blocklist changes, facilitating real-time updates in applications. - [Follow](https://pre.trtc.io/document/66035.md): The JavaScript Follow feature API provides SDK methods to manage user follow interactions including following, unfollowing, and retrieving followers, following, and mutual followers lists. It supports batch operations for up to 20 users and pagination for lists up to 500 users per request. This API is designed for developers using the Pro, Pro-plus, or Enterprise editions to build interactive social features within their applications. ### Group Channels - [Overview](https://pre.trtc.io/document/48169.md): The Chat SDK offers various group types including work groups, public groups, meeting groups, communities, and audio-video groups to support diverse chat scenarios. This overview explains the capabilities and limits of each group type, such as member roles, join approvals, and message history management. It also highlights the requirements for using community groups and configuration options for enabling message history retrieval. The Chat SDK is designed for developers to implement flexible and scalable group communication features. - [Group Channel Settings](https://pre.trtc.io/document/48465.md): The JavaScript SDK for Tencent Cloud Chat provides comprehensive group management APIs that enable developers to create, search, join, leave, disband, and manage groups of various types including work, public, meeting, audio-video, and community groups. This reference details the methods, parameters, and usage examples for handling group events, managing group membership, and processing join requests to facilitate real-time communication scenarios. - [Group Channel Profile](https://pre.trtc.io/document/48184.md): The Chat Group Profile API for the JavaScript SDK provides methods to retrieve and update group information such as group name, avatar, introduction, notification, and custom fields. It supports filtering custom group fields when fetching profiles and allows modifications including muting all members and setting group invite options. This API is designed for developers managing group attributes in chat applications using Tencent RTC. - [Member Management (Mute & Ban)](https://pre.trtc.io/document/48180.md): The JavaScript getGroupMemberList API is part of the Tencent Cloud Chat SDK, enabling developers to retrieve group member lists with support for role filtering, online status, and mute timestamps. It supports pagination and is optimized for Pro edition and above in AVChatRoom scenarios. This API helps manage group membership details efficiently for chat applications. - [Member Profile](https://pre.trtc.io/document/48177.md): Tencent Cloud Chat JavaScript SDK provides APIs for managing group members, including retrieving member profiles, setting name cards, customizing member fields, and marking members. These APIs support operations on standard groups with permission controls and return Promise-based responses. Note that AVChatRoom groups have limited support for these operations. - [Group Channel Attributes](https://pre.trtc.io/document/48174.md): The JavaScript Group Attributes API provides SDK methods to manage seats in audio chat rooms by setting, deleting, and retrieving group attribute key-value pairs. It supports initializing group attributes, updating them with concurrency control, and deleting specific or all attributes. This API is designed for developers integrating audio chat room features on web platforms, enabling real-time seat management and synchronization among group members. - [Group Channel Counter](https://pre.trtc.io/document/56042.md): Tencent Cloud Chat SDK offers the group counter feature, enabling integer-type data storage for various group-related metrics such as viewer counts, likes, and gifts. Designed for all group types except topic-enabled community groups and available in the Premium edition, it supports up to 20 counters per group with precise API controls for setting, incrementing, decrementing, and retrieving counter values. This overview explains the core capabilities and usage considerations of group counters within the Chat SDK. ### Community Channels - [Manage Community](https://pre.trtc.io/document/48171.md): The JavaScript SDK for Tencent Cloud Chat provides APIs to manage community groups and their topics. It enables developers to create topic-enabled communities, retrieve lists of joined communities, create and delete topics within communities, modify topic profiles, and listen for topic update events. These APIs support building interactive community features with topic-based message management for web applications. ### Messages - [Overview](https://pre.trtc.io/document/47990.md): The Message Class in the Chat SDK JavaScript API defines the structure and attributes of messages, including type, content payloads, conversation details, sender and receiver information, message flow, status, priority, and read receipt data. This reference is designed for developers integrating chat functionalities who need detailed information on message object properties and usage within the Tencent RTC Chat SDK. - [Send a Message](https://pre.trtc.io/document/47993.md): The JavaScript Chat SDK provides APIs to create various types of chat messages including text, @mention, image, audio, video, and custom messages. These APIs return message instances that can be sent to individual users or groups, supporting features like message priority, targeted recipients, and cloud-stored custom data. This reference details the parameters and usage for creating messages within Tencent Cloud Chat, enabling developers to implement rich messaging functionalities. - [Receive a Message](https://pre.trtc.io/document/47996.md): TencentCloudChat JavaScript SDK provides APIs for listening to and canceling event listeners, enabling developers to handle MESSAGE_RECEIVED and other events effectively. This guide explains how to use chat.on and chat.off methods with event names stored in TencentCloudChat.EVENT to receive various message types such as text, image, audio, and more. It is essential to register event listeners before login to avoid missing any events delivered by the SDK. - [Message History](https://pre.trtc.io/document/47999.md): The Chat JavaScript SDK provides APIs for retrieving message lists by page, sequence, or time range. It supports various editions with different historical message storage durations, from 7 to 90 days, with options to extend storage as a value-added service. The getMessageList API fetches messages paged for conversations including one-to-one and group chats, while getMessageListHopping allows retrieval by specific sequences or time ranges. These APIs enable efficient message history access for chat applications. - [Forward Messages](https://pre.trtc.io/document/48002.md): The JavaScript Chat SDK provides APIs to create, send, and download merged chat messages for one-to-one and group conversations. It enables developers to merge multiple original messages into a single merged message with customizable titles, digest lists, and compatibility text. The SDK also supports downloading large merged messages stored in the cloud before viewing, ensuring seamless message forwarding and display. - [Edit Message](https://pre.trtc.io/document/48005.md): The chat.modifyMessage API in the JavaScript SDK allows users to modify successfully sent messages within a conversation by updating fields such as cloudCustomData. This API supports text, custom, geographical location, and emoji messages but excludes online and AVChatRoom messages. Upon successful modification, all relevant users receive a MESSAGE_MODIFIED event. The method returns a Promise and handles conflict and error codes like 2480 for modification conflicts. - [Delete Messages](https://pre.trtc.io/document/48010.md): The JavaScript deleteMessage API enables deletion of up to 30 messages within the same conversation for Tencent RTC chat. It is designed for developers to manage message removal in one-to-one and group chats, ensuring deleted messages are marked as isDeleted and cannot be retrieved on subsequent logins. This API returns a Promise and restricts calls to once per second, with limitations such as no support for audio-video groups or group system notifications. - [Clear History Message](https://pre.trtc.io/document/53498.md): The chat.clearHistoryMessage API in JavaScript provides a method to clear all messages in a conversation both locally and from the cloud without deleting the conversation itself. It supports one-to-one and group chats by specifying the conversation ID and returns a Promise indicating success or failure. This API is designed for developers managing chat message histories within Tencent RTC. - [Recall a Message](https://pre.trtc.io/document/48015.md): The revokeMessage API in the Chat JavaScript SDK enables recalling one-to-one or group messages within a configurable time limit. It returns a Promise indicating success or failure of the recall operation. Developers can use the isRevoked attribute to identify recalled messages when retrieving message lists via getMessageList, ensuring proper UI display of recall notifications. - [Online Message](https://pre.trtc.io/document/48018.md): The JavaScript Chat SDK provides online-only messaging capabilities and typing indicators for one-to-one chats. It enables messages to be received only when the receiver is online, preventing offline storage, roaming, and local history retrieval. The SDK supports sending typing status updates to enhance user interaction, with UI prompts such as "Typing..." displayed in real time. The TUIKit library offers ready-to-use components for integrating these features efficiently. - [Read Receipt](https://pre.trtc.io/document/48021.md): The JavaScript SDK for Tencent Cloud Chat provides message read receipt capabilities, enabling senders to track who has read their messages. This feature supports one-to-one and group conversations and requires enabling the read receipt flag when sending messages. It is available for Pro, Pro Plus, and Enterprise edition customers and is not supported in Community groups or AVChatRoom. The API includes methods for sending read receipts, listening for receipt notifications, and retrieving read status information. - [Query Messages](https://pre.trtc.io/document/48024.md): The JavaScript SDK for Tencent Cloud Chat provides APIs to query messages locally by messageID and to search cloud messages with flexible filters including keywords, sender IDs, message types, conversation scope, and time range. Local message queries support received and historical messages saved on the device, excluding AVChatRoom messages. Cloud message search requires a purchased plugin and supports pagination with cursor and rate limits. These APIs enable developers to efficiently retrieve chat messages for enhanced user experience. - [Mentions (@)](https://pre.trtc.io/document/66032.md): The JavaScript SDK provides APIs to send group @mention messages in Tencent RTC group chats. This guide explains how to trigger the member selection UI upon typing '@', create a text message with @mentions using createTextAtMessage, and send it with sendMessage. It supports specifying individual users or @all mentions, message priority, and custom cloud data for persistent messaging. - [Targeted Message](https://pre.trtc.io/document/52716.md): The JavaScript SDK provides targeted group messaging capability, allowing messages to be sent to specified members within a group while excluding others. This feature is intended for users with Pro, Pro Plus, or Enterprise editions and supports sending and receiving targeted messages via specific APIs. The guide covers UI display, message creation with receiver lists, sending messages, and how targeted messages are handled in unread counts. - [Do Not Disturb](https://pre.trtc.io/document/48031.md): The Chat SDK provides an API to configure message receiving options for one-to-one and group chats, enabling features such as notification muting and message rejection. This API allows developers to set the conversation message notification type by specifying parameters like group ID, user ID list, and message reminder type. It supports five distinct message receiving modes and synchronization across multiple devices, helping users control how they receive and are notified of chat messages. - [Message Extension](https://pre.trtc.io/document/54166.md): Tencent Cloud Chat JavaScript SDK provides message extension APIs to configure key-value pairs on messages, enabling features like polling, group notices, and surveys. The setMessageExtensions API allows adding or updating extensions on messages, while the getMessageExtensions API retrieves existing extensions. These APIs require the message to support extensions and be successfully sent. This functionality is exclusive to Advanced Edition customers and must be enabled in the Chat Console. The SDK handles extension conflicts with error codes and events to ensure data consistency. - [Reactions](https://pre.trtc.io/document/60749.md): The JavaScript Message Response API in Tencent Cloud Chat SDK provides methods to add, remove, batch retrieve, and paginate emoji reactions on messages. Designed for advanced users with Pro or Enterprise editions, it enables interactive message reactions by managing emoji usage and user profiles. Key interfaces include addMessageReaction, removeMessageReaction, getMessageReactions, and getAllUserListOfMessageReaction, with event notifications for reaction updates. - [Message Translation](https://pre.trtc.io/document/55857.md): The chat.translateText API provides text message translation capabilities within the Tencent RTC JavaScript SDK. It enables developers to translate text messages between supported languages by invoking the API with specified source texts, source language, and target language. This feature is available to Pro, Pro Plus, and Enterprise customers who have enabled Text Message Translation in the Chat Console. The API returns a Promise with translated text results and supports multiple languages including English, Chinese, Japanese, French, German, and more. - [Voice-to-Text](https://pre.trtc.io/document/60751.md): The chat.convertVoiceToText API in Tencent RTC provides speech-to-text conversion for voice messages in various audio formats. It supports multiple languages including Chinese, English, Cantonese, and Japanese. This API is designed for developers to convert voice messages into text, enhancing communication capabilities in applications. The method accepts an options object with message and language parameters and returns a Promise with the conversion result. ### Conversations - [Overview](https://pre.trtc.io/document/48328.md): The JavaScript Chat SDK provides a Conversation class API to manage different types of conversations including one-to-one, group, and system notification sessions. It enables developers to display and update conversation lists, handle unread message counts, pin conversations, and configure message reminders. The SDK supports pulling recent conversations with configurable limits and maintains message storage policies with a default retention of 7 days. - [Conversation List](https://pre.trtc.io/document/48325.md): Tencent Cloud Chat JavaScript SDK provides the getConversationList API to retrieve conversation lists with various filtering options such as conversation type, mark type, and group name. This API enables developers to efficiently manage and display conversations in their applications. Additionally, the SDK supports listening for conversation list update events to keep the UI synchronized with the latest conversation data. - [Get Conversations](https://pre.trtc.io/document/48322.md): The Chat SDK JavaScript API includes the getConversationList method, which allows developers to retrieve conversation objects for one or multiple specified conversations. This API supports filtering by conversation type, mark type, group name, and unread status, enabling efficient management of conversation lists. It returns a promise with conversation data and is designed for applications requiring dynamic conversation retrieval and display. - [Unread Count](https://pre.trtc.io/document/48319.md): The JavaScript SDK provides APIs to manage unread message counts in one-to-one and group conversations. It enables developers to retrieve the total unread message count, receive notifications when the unread count changes, and clear unread counts for individual or all conversations. These APIs support Work, Public, Community, and Meeting groups, excluding AVChatRoom and system conversations. The SDK synchronizes conversation lists from the cloud and offers promise-based methods for asynchronous operations. - [Pin Conversations](https://pre.trtc.io/document/48316.md): The chat.pinConversation method in the JavaScript SDK allows developers to pin or unpin one-to-one or group conversations at the top of the conversation list. This feature helps users quickly access important chats by fixing them at the top, with the pinned status synchronized across devices. The API accepts a conversationID and a boolean isPinned to control the pinning state, returning a Promise that resolves upon success. The maximum number of pinned conversations is limited to 50. - [Delete Conversations](https://pre.trtc.io/document/48313.md): The JavaScript deleteConversation API in the Tencent Cloud Chat SDK allows users to delete one-to-one or group chat conversations with options to clear or retain chat history. It supports bulk deletion of up to 100 conversations and multi-client synchronization can be enabled via the Chat Console. This API is designed for developers integrating chat features who need to manage conversation data efficiently. - [Conversation Draft](https://pre.trtc.io/document/56184.md): The setConversationDraft API in the JavaScript chat SDK enables saving and managing text-only conversation drafts locally. It allows users to save unfinished messages per conversation, which can be retrieved later from the local database. This API supports both one-to-one and group chats by specifying the conversation ID. It helps improve user experience by preserving draft content when switching chat windows, though drafts are not synced across devices or retained after app reinstall. - [Conversation Mark](https://pre.trtc.io/document/50291.md): The JavaScript SDK of Tencent Cloud Chat provides APIs to mark conversations with labels such as favorite, collapsed, hidden, or unread, and to set custom data for conversations. This guide explains how to use these APIs to manage conversation marks and custom data, including parameters, return values, and example usage. It is intended for developers integrating conversation marking features into their applications using Tencent Cloud Chat SDK. - [Conversation Group](https://pre.trtc.io/document/50289.md): The JavaScript SDK for Tencent Cloud Chat provides APIs to manage conversation groups, including creating, deleting, renaming groups, and fetching the list of conversation groups. These APIs enable developers to organize conversations into groups such as "Product experience" or "R&D" for better management. The SDK supports event notifications for conversation list and group list updates, facilitating real-time synchronization in applications. ### Search - [Cloud Cloud Search Messages](https://pre.trtc.io/document/67677.md): The JavaScript searchCloudMessages API is part of Tencent Cloud Chat SDK, enabling efficient cloud message search based on keywords, sender IDs, message types, and conversation IDs. Designed for Pro Plus and Enterprise users, it helps quickly locate specific messages across all or specified conversations, improving information retrieval speed and accuracy. The API supports pagination with cursors and time-based filtering, excluding communities and live broadcast groups. - [Cloud Search Users](https://pre.trtc.io/document/67679.md): The searchCloudUsers API in the JavaScript Chat SDK enables keyword-based searching of cloud users, supporting both fuzzy nickname matching and precise userID matching. It returns basic user profile information such as avatar, nickname, userID, gender, birthday, and self-signature, suitable for rendering user search results. The API supports filters including gender and birthday range, returns paginated results with a cursor, and enforces call frequency limits. For detailed user profiles, use the getUserProfile API. - [Cloud Search Channels](https://pre.trtc.io/document/67681.md): The searchCloudGroups API in Tencent Cloud Chat JavaScript SDK enables users to quickly locate or discover cloud groups by performing keyword-based fuzzy and precise searches on group names and IDs. It supports filtering by multiple group types and returns essential group profile information to facilitate group management and participation. This API is subject to call frequency limits and excludes live groups from search results. Pagination is supported through a cursor mechanism for continuous retrieval of search results. - [Cloud Search Channel Members](https://pre.trtc.io/document/67683.md): Tencent Cloud Chat JavaScript SDK provides the searchCloudGroupMembers API to perform keyword fuzzy matching searches for cloud group members across all groups a user has joined. This API supports filtering by keywords, group types, and specific group IDs, returning partial group and member information for efficient group member management. It is available from version 3.5.0 and intended for Pro Plus and Enterprise customers, with usage limits to ensure optimal performance. ### Extended Features - [Cloud Search](https://pre.trtc.io/document/60140.md): This guide explains how to quickly integrate the Message Cloud Search feature using TUIKit on Web, uni-app, and Mini Program platforms. It is designed for developers who want to enable message searching capabilities globally or within conversations. The integration involves installing TUIKit, activating the cloud search plugin, and using the component. The feature supports trial usage and requires purchase for full functionality, targeting Pro Plus and Enterprise customers. ### Client APIs - [Client APIs](https://pre.trtc.io/document/33999.md): TencentCloudChat JavaScript SDK is a comprehensive API library for implementing chat functionalities on web platforms. It enables developers to create SDK instances, manage conversations, handle messages, user profiles, friends, groups, and signaling. The SDK provides event handling, plugin registration, logging controls, and lifecycle management APIs to build robust chat applications with features such as message sending, reactions, and group system messages. ### Changelog - [Changelog](https://pre.trtc.io/document/34281.md): Tencent Cloud Lite Chat V4 SDK Web release notes detail the latest features and bug fixes from version 4.0.0 through 4.3.0. This changelog is intended for developers using the Lite Chat SDK to build real-time communication applications on web platforms. It highlights new methods, platform support, and issue resolutions to enhance product stability and real-time capabilities.