@apirtc/apirtc

中文文档
5.0.37发布于 2026/09/30ICSTypeScriptCommonJS零依赖近 30 天下载 3851

ApiRTC - set up your WebRTC service easily!

原始使用文档
文档目录4 节
  1. Installation
  2. Usage
  3. Module
  4. Global object

ApiRTC

ApiRTC is real time web communication library. It will enable you to easily add communication (chat, audio, video, file transfer, drawings) into your application.

ApiRTC makes web communication easy as a breeze using ApiRTC's infrastructure and WebRTC technology.

One of main avantage of ApiRTC is to be compatible with lot of differents browsers and versions. ApiRTC keeps evolving with the support of new APIs and features on web browsers.

Changelog available on github.

Installation

npm i @apirtc/apirtc --save

or

yarn add @apirtc/apirtc

Usage

Module

import { UserAgent, Session } from '@apirtc/apirtc';

or

import apiRTC from '@apirtc/apirtc';

Eg:

let ua = new UserAgent({
    uri: "apzkey:myDemoApiKey",
});

let registerInformation = {
    cloudUrl: "https://cloud.apirtc.com",
};

ua.register(registerInformation)
    .then((session) => {
        console.log("User registered with session: ", session);
    })
    .catch((error) => {
        console.error("User agent registration failed", error);
    });

Global object

You can use apiRTC object from the global scope.

<script src="node_modules/@apirtc/apirtc/apiRTC.min.js"></script>

or

<script src="https://cloud.apirtc.com/apiRTC/apiRTC-latest.min.js"></script>

<script>
let ua = new apiRTC.UserAgent({
    uri: "apzkey:myDemoApiKey",
});
</script> 

Documentation

If you want to get started, you should take a look at our Getting started guide and API Quick start guide

We have also prepared a number of tutorials & samples to simplify the ApiRTC integration in your application.

API Reference Documentation

版本与发布记录

@apirtc/apirtc 共发布 146 个版本,首次发布于 2021/11/10;过去 12 个月发布了 15 个版本。

版本发布日期距今
5.0.37latest2026/09/301 个月前
5.0.37-rc.3release-candidate2026/09/301 个月前
5.0.37-rc.22026/09/101 个月前
5.0.37-rc.12026/09/091 个月前
5.0.362026/08/182 个月前
5.0.36-rc.42026/08/142 个月前

关于 @apirtc/apirtc 的常见问题

@apirtc/apirtc 是什么?

ApiRTC - set up your WebRTC service easily!

如何安装 @apirtc/apirtc?

在项目目录运行 npm install @apirtc/apirtc,或使用 pnpm add / yarn add / bun add。

@apirtc/apirtc 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@apirtc/apirtc 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@apirtc/apirtc 可以商用吗?

@apirtc/apirtc 使用 ICS 许可。声明的许可为 ICS,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@apirtc/apirtc 的下载量有多少?

根据 npm 官方下载统计,@apirtc/apirtc 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,851 次,日均约 128 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apirtc/apirtc 还在维护吗?

最新版本 5.0.37 发布于 2026/09/30(1 个月前);至今共发布 146 个版本,其中过去 12 个月发布了 15 个;首次发布于 2021/11/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。