npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tencent-classroom/sdk

v2.0.0-alpha.1

Published

腾讯云互动课堂 SDK — 纯 TypeScript,零框架依赖 / Tencent Cloud Interactive Classroom SDK

Downloads

329

Readme

@tencent-classroom/sdk

腾讯云实时互动-教育版, 即原腾讯云互动课堂, 无 UI SDK(Web 端)— 纯 TypeScript,零框架依赖。

Tencent Cloud Low-Code Interactive Classroom SDK for Web — Pure TypeScript, framework-agnostic.

npm version license

安装 / Installation

NPM(推荐)/ NPM (Recommended)

npm install @tencent-classroom/sdk
# or
pnpm add @tencent-classroom/sdk

CDN / Script Tag

通过 unpkg 直接引入(将 {VERSION} 替换为实际版本号,如 2.0.0):

Load via unpkg — replace {VERSION} with the actual version (e.g. 2.0.0):

<script src="https://unpkg.com/@tencent-classroom/sdk@{VERSION}/dist/umd/tencent-classroom-sdk.js"></script>
<script>
  const { TencentClassroom, TEvent, StreamType } = TencentClassroomSDK;
  // ...
</script>

建议 / Recommendation

unpkg 是社区 CDN,加载速度受网络环境影响。为保障生产环境的加载性能和稳定性,强烈建议将该文件下载后部署到自己的 CDN:

  1. 下载文件:https://unpkg.com/@tencent-classroom/sdk@{VERSION}/dist/umd/tencent-classroom-sdk.js
  2. 上传至你的 CDN 或静态资源服务
  3. 在页面中引用你自己的 CDN 地址

For production use, we strongly recommend downloading the UMD bundle and hosting it on your own CDN to ensure load performance and availability.

AI 辅助开发 / AI-Assisted Development

npx skills add InteractiveClassroom/skills --skill tcic-sdk-helper

快速上手 / Quick Start

import { TencentClassroom, TEvent, StreamType } from '@tencent-classroom/sdk';

// 1. 创建实例 / Create instance
const classroom = new TencentClassroom({ language: 'zh-CN' });

// 2. 初始化 / Initialize
await classroom.init();

// 3. 监听关键事件 / Listen to key events
classroom.on(TEvent.KICK_OUT, ({ message }) => alert(message));
classroom.on(TEvent.CLASS_END, () => console.log('课堂结束'));

// 4. 进房 / Join classroom
const result = await classroom.joinClass({
  classId: 123456,
  userId: 'student_001',
  token: 'your_token',
});

if (!result.ok) {
  console.error('进房失败:', result.message);
  return;
}

// 5. 开启摄像头 / Start camera
await classroom.startCamera(document.getElementById('local-video'));

// 6. 绑定远端视频 / Bind remote video
const binding = classroom.bindRemoteView(
  'teacher_001',
  document.getElementById('remote-video'),
  StreamType.Camera,
);

// 7. 发送消息 / Send message
await classroom.sendTextMessage('大家好!');

// 8. 订阅响应式状态 / Subscribe to reactive state
const unsub = classroom.state.classStatus$.subscribe(status => {
  console.log('课堂状态:', status); // 'notStarted' | 'started' | 'ended'
});

// 9. 离房 / Leave
await classroom.leaveClass();
await classroom.destroy();
unsub();

文档 / Documentation

完整 API 文档请访问:https://www.tencentclass.net/docs/sdk/

浏览器兼容性 / Browser Compatibility

支持现代浏览器(Chrome 72+、Firefox 68+、Safari 12.1+、Edge 79+)。依赖 WebRTC,不支持 IE。

License

MIT