Socket
Socket
Sign inDemoInstall

tim-wx-sdk

Package Overview
Dependencies
0
Maintainers
11
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tim-wx-sdk

Tencent Cloud Chat SDK for Wechat Mini Program


Version published
Weekly downloads
246
increased by66.22%
Maintainers
11
Install size
2.24 MB
Created
Weekly downloads
 

Readme

Source

腾讯云即时通信 IM 小程序 SDK

关于我们

即时通信 IM(Instant Messaging)基于 QQ 底层 IM 能力开发,仅需植入 SDK 即可轻松集成聊天、会话、群组、资料管理和直播弹幕能力,也支持通过信令消息与白板等其他产品打通,全面覆盖您的业务场景,支持各大平台小程序接入使用,全面满足通信需要。

含 UI 集成(荐)

请参考官网文档 快速入门

无 UI 集成

您可以通过 npm 方式集成 SDK:

// IM 小程序 SDK
npm install tim-wx-sdk --save
// 发送图片、文件等消息需要的上传插件
npm install tim-upload-plugin --save
// 文本本地审核插件
npm install tim-profanity-filter-plugin --save

在项目脚本里引入模块,并初始化。

import TIM from 'tim-wx-sdk';
import TIMUploadPlugin from 'tim-upload-plugin';
import TIMProfanityFilterPlugin from 'tim-profanity-filter-plugin';

let options = {
  SDKAppID: 0 // 接入时需要将 0 替换为您的云通信应用的 SDKAppID,类型为 Number
};
// 创建 SDK 实例,`TIM.create()`方法对于同一个 `SDKAppID` 只会返回同一份实例
let tim = TIM.create(options); // SDK 实例通常用 tim 表示

// 设置 SDK 日志输出级别,详细分级请参见 setLogLevel 接口的说明
tim.setLogLevel(0); // 普通级别,日志量较多,接入时建议使用
// tim.setLogLevel(1); // release级别,SDK 输出关键信息,生产环境时建议使用

// 注册腾讯云即时通信 IM 上传插件
tim.registerPlugin({'tim-upload-plugin': TIMUploadPlugin});

// 注册腾讯云即时通信 IM 本地审核插件
tim.registerPlugin({'tim-profanity-filter-plugin': TIMProfanityFilterPlugin});

// 接下来可以通过 tim 进行事件绑定和构建 IM 应用
相关资源

Keywords

FAQs

Last updated on 23 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc