This document describes how to quickly integrate the Tencent Cloud Chat SDK into your web project.
File Structure of the SDK
Integrating the SDK
You can integrate the Chat SDK into your web project by using npm (recommended).
You can integrate the upload plugin for faster and safer upload of rich media resources. For more information, see tim-upload-plugin. You can integrate the local moderation plugin tim-profanity-filter-plugin to moderate the text content sent by the Chat SDK on the client locally. The plugin can intercept or replace configured sensitive words in the text content to ensure your product experience and business security. Integration via npm (recommended)
Use npm to install appropriate Chat SDK dependencies in your project.
npm install @tencentcloud/chat --save
npm install tim-upload-plugin --save
npm install tim-profanity-filter-plugin --save
import TencentCloudChat from '@tencentcloud/chat';
import TIMUploadPlugin from 'tim-upload-plugin';
import TIMProfanityFilterPlugin from 'tim-profanity-filter-plugin';
let options = {
SDKAppID: 0
};
let chat = TencentCloudChat.create(options);
chat.setLogLevel(0);
chat.registerPlugin({'tim-upload-plugin': TIMUploadPlugin});
chat.registerPlugin({'tim-profanity-filter-plugin': TIMProfanityFilterPlugin});
Relevant resources
FAQs
1. Are there any open-source UI components that can be reused or redeveloped?
Tencent Cloud Chat provides open-source UIKits for all platforms that can be reused or redeveloped by developers. Find the reference documentation below:
Was this page helpful?