0.1.0-alpha.14

中文文档
0.1.0发布于 2026/05/29TypeScriptES Module

Vroom Core SDK - Platform-agnostic RTC abstraction layer

原始使用文档
文档目录11 节
  1. Features
  2. Installation
  3. React Native
  4. Quick Start
  5. API Reference
  6. Vroom
  7. Session
  8. Events
  9. Error Handling
  10. Contributing
  11. License

Vroom Client JS

Platform-agnostic Core SDK for building real-time communication experiences.

Features

  • Simple API - Initialize once, connect to rooms with a single call
  • Auto Token Exchange - SDK handles authentication automatically
  • Type-Safe - Full TypeScript support
  • Production Ready - Auto-reconnect and error handling built-in

Installation

npm install @vroom/client-js

React Native

WebRTC globals are initialized automatically inside Vroom.connect() — no manual polyfill setup required.

For RN-specific helpers (e.g., RTCView for rendering remote video), use the dedicated subpath:

import { RTCView, MediaStream } from '@vroom/client-js/react-native'

Required peer dependencies

npm install @livekit/react-native @livekit/react-native-webrtc

Then on iOS, run pod install.

Quick Start

import { Vroom, SessionEvent } from '@vroom/client-js'

// 1. Initialize (once at app startup)
await Vroom.init({ apiKey: 'your-api-key' })

// 2. Connect to room
const session = await Vroom.connect({
  roomName: 'meeting-123',
  user: { id: 'user-1', displayName: 'Alice', role: 'host' },
  type: 'group',
  media: { audio: true, video: true },
  eventHandlers: {
    [SessionEvent.ParticipantJoined]: ({ participant }) => {
      console.log(`${participant.displayName} joined`)
    },
    [SessionEvent.TrackAdded]: ({ track }) => {
      if (track.mediaStreamTrack) {
        videoElement.srcObject = new MediaStream([track.mediaStreamTrack])
      }
    }
  }
})

// 3. Control media
session.disableMic()
session.enableCamera()

// 4. Disconnect
await session.disconnect()

API Reference

Vroom

MethodDescription
init(config)Initialize SDK with API key
connect(params)Connect to room
reset()Reset SDK state

Session

MethodDescription
enableMic() / disableMic()Toggle microphone
enableCamera() / disableCamera()Toggle camera
switchDevice(options)Switch audio/video input or output device
getActiveDevice(kind)Get currently active device ID
getParticipants()Get all participants
roomRoom info (name, sid, createdAt) — immutable for the connection
disconnect()Disconnect from room
on(event, handler)Add event listener

Events

EventDescription
SessionEvent.ConnectedConnected to room
SessionEvent.DisconnectedDisconnected from room
SessionEvent.ParticipantJoinedParticipant joined
SessionEvent.ParticipantLeftParticipant left
SessionEvent.TrackAddedTrack published
SessionEvent.TrackRemovedTrack unpublished
SessionEvent.ErrorError occurred

Error Handling

try {
  await Vroom.connect({ ... })
} catch (error) {
  if (error.code === 'E_INVALID_API_KEY') {
    // Handle invalid API key
  }
}

Contributing

See CONTRIBUTING.md.

License

MIT

版本与发布记录

0.1.0-alpha.14 共发布 1 个版本,首次发布于 2026/05/29;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.0latest2026/05/295 个月前

关于 0.1.0-alpha.14 的常见问题

0.1.0-alpha.14 是什么?

Vroom Core SDK-与平台无关的RTC抽象层

如何安装 0.1.0-alpha.14?

在项目目录运行 npm install 0.1.0-alpha.14,或使用 pnpm add / yarn add / bun add。

0.1.0-alpha.14 支持 TypeScript 吗?

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

0.1.0-alpha.14 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

0.1.0-alpha.14 可以商用吗?

0.1.0-alpha.14 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

0.1.0-alpha.14 还在维护吗?

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