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

@unified-communications/meeting-plugin

v0.2.1

Published

Vue 3 集成插件,安装后直接引用。插件提供应用分享建会组件和平台用户 iframe 组件,负责受限会话传递并承载 Unified Communications Platform 的原生会议页面,不包含 Jitsi/lib-jitsi。

Readme

@unified-communications/meeting-plugin

Vue 3 集成插件,安装后直接引用。插件提供应用分享建会组件和平台用户 iframe 组件,负责受限会话传递并承载 Unified Communications Platform 的原生会议页面,不包含 Jitsi/lib-jitsi。

安装

npm install @unified-communications/meeting-plugin

vue(^3.5.0)是宿主的 peer dependency,由业务项目自己提供。发布包已包含完整构建产物,业务项目不需要重新构建:

  • dist/index.js:创建会议和会话消息 API;
  • dist/vue.js:MeetingPlugin 和 PlatformUserMeetingEmbed Vue 组件;
  • dist/style.css:组件样式;
  • dist/types/:TypeScript 声明文件。

使用

<script setup lang="ts">
import MeetingPlugin from '@unified-communications/meeting-plugin/vue';
import '@unified-communications/meeting-plugin/style.css';
</script>

<template>
  <MeetingPlugin
    base-url="https://nexuspoint.cn:20124"
    embed-base-url="https://nexuspoint.cn:20124"
    app-id="sma1_..."
    share-key="smk1_..."
    title="城市运行指挥大屏会议"
    display-name="大屏值守席"
  />
</template>

base-url 必须指向 Unified Communications Platform 服务或同源反向代理前缀。组件调用 POST /api/v1/applications/{appId}/meetings,分享 Key 只用于创建受限会议,会议页面使用服务端签发的短期 token;组件会把会议会话转换为可结构化克隆的普通对象后再发送给 iframe;不要把服务端 credential、平台配置密钥或 ZLM secret 写进浏览器代码。

当前公网试用平台为 https://nexuspoint.cn:20124。如果第三方页面与该地址不同源,base-url 和 embed-base-url 都可以直接填写这个地址,但平台服务端必须允许第三方页面的 CORS、WebSocket Origin 和 iframe 访问;同源反向代理部署时可将两者改为同源路径。

本地开发时可单独配置 embed-base-url="http://127.0.0.1:20121",让 iframe 使用前端 Vite 源码页;iframe 内的 API 和 WebSocket 仍由前端 Vite 代理到 Go 服务。生产环境通常省略该属性,使 iframe 与 base-url 同源加载 /#/embed/meeting。组件会等待 iframe 完成导航后再发送会话,避免跨域 iframe 初始 about:blank 继承父页面 Origin 导致 postMessage 失败,并为会议页声明摄像头、麦克风、屏幕共享和自动播放权限。

统一用户中心嵌入

公司宿主已经持有 User Center Token 时,使用命名导出的 PlatformUserMeetingEmbed。组件将 Token 和会议 ID 通过限制来源的 postMessage 发送给 iframe;平台嵌入页会重新调用 /auth/me 和会议详情接口确认身份及会议权限,Token 不会进入 URL。

<script setup lang="ts">
import { PlatformUserMeetingEmbed } from '@unified-communications/meeting-plugin/vue';
import '@unified-communications/meeting-plugin/style.css';

const companyAuth = { accessToken: '由宿主认证模块提供', expiresAt: '2026-08-26T12:00:00Z' };
const meetingId = '已创建或已受邀会议 ID';
const userCenterPersonIds = ['119286'];
</script>

<template>
  <PlatformUserMeetingEmbed
    base-url="https://meeting.example.com"
    :access-token="companyAuth.accessToken"
    :expires-at="companyAuth.expiresAt"
    :meeting-id="meetingId"
    :user-center-person-ids="userCenterPersonIds"
  />
</template>

accessToken 可以是平台接受的 User Center 用户 Token,也可以是用户中心授权码流程返回的 sm1_ 平台 Session。可选 user-center-person-ids 沿用历史命名,首选接收用户中心人员代码 human.id(如 b28129c9-fc35-4014-bc97-6dfc4b0c9422),并兼容已投影的 personId/userId/human.code 或兼容身份主键;不接受平台内部 app_user.id。组件在建会或会议进行中更新该数组时先调用邀请接口,成功后才向 iframe 发送会话。人员代码未投影时由平台在当前租户有界精确查询。父页面和 iframe 的 Origin 必须受平台 CORS、WebSocket 与 iframe 策略允许。生产宿主负责 Token 刷新;刷新后重新加载 iframe 并下发新会话。不要把 Token 或人员 ID 放入 URL、日志、分析事件或跨站持久化存储。

第三方邀请

应用需要授予 meeting:control 后,第三方可以用插件导出的 createApplicationInvitationLink 为已创建的会议生成邀请链接:

import { createApplicationInvitationLink } from '@unified-communications/meeting-plugin';

const link = await createApplicationInvitationLink(baseUrl, appId, shareKey, session.meeting.id, {
  expiresInMinutes: 480,
  maxRegistrations: 10
});
const url = new URL(link.registrationPath, baseUrl);
console.log(url.toString());
// Hand link.password to the invitee through a separate channel. Never append it to the
// URL: browser history, reverse-proxy access logs, chat link previews and the Referer
// header would all receive it, and the second factor would be defeated.

registrationPath 始终为 /#/join/:token(包含反向代理前缀时保留前缀),插件也会兼容旧服务返回的 /join/:token。注册页要求受邀人手动输入 6 位会议密码,不复用 URL 参数。

需要撤销已生成的链接时调用 closeApplicationInvitationLink(baseUrl, appId, shareKey, session.meeting.id, link.id);关闭操作幂等,已关闭链接不会再接受注册。

插件还导出 listApplicationMeetings(baseUrl, appId, shareKey) 和 endApplicationMeeting(baseUrl, appId, shareKey, meetingId),用于查询当前应用的进行中会议并结束遗留会议。这两个接口需要应用具备 meeting:control scope;结束会议请求不携带请求体。应用创建会议异常退出时,可在 SDK Demo 或业务自己的管理页面调用它们释放并行会议额度。

接口返回的 password 只用于当前创建结果;应用单场人数和并行会议上限由平台服务端强制执行,maxRegistrations 只是当前邀请链接的注册上限。

组件事件:started 表示平台已返回短期会议会话,ready 表示嵌入页已接收会话,error 表示创建或嵌入失败。Share Key 属于受限应用凭证,生产环境优先通过受控后端或同源代理注入,不要写入公开仓库或 URL。

应用可先调用 getApplicationMeetingPolicy 获取 maxParticipantsPerMeeting、maxActiveMeetings、服务端 serverTime 和有效 maxMeetingDurationMinutes,再展示配额并提交 scheduledAt/scheduledEndAt 建会。应用时长上限继承系统配置或进一步收紧,客户端不得把本地固定值视为权威策略。

插件导出 joinApplicationMeeting(baseUrl, appId, shareKey, meetingId),用于加入 listApplicationMeetings 返回的进行中会议。它会调用 POST /api/v1/applications/{appId}/meetings/{meetingId}/session 换取新的短期主持人会话,需要 meeting:join scope,并由服务端校验会议归属;列表本身不会返回或保存旧 token。

源码构建

以下命令只用于在本仓库内从源码构建和验证产物,通过 npm 安装的消费方不需要执行:

cd packages/meeting-plugin
npm install
npm run build

npm pack 和 npm publish 会通过 prepack 自动执行构建,因此发布包始终带最新的 dist/ 产物。