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

@eleven-am/vox-rtc-client

v0.1.2

Published

Browser-side SDK for Vox-hosted WebRTC media sessions

Readme

@eleven-am/vox-rtc-client

Browser-side SDK for Vox-hosted WebRTC media sessions.

This package is for frontend applications that need to:

  • join a Vox RTC session with WebRTC
  • capture microphone audio
  • receive remote assistant audio
  • handle Vox ICE candidate exchange
  • send and receive app events over the Vox data channel

It does not hold a Vox API key. Create the RTC session from your backend with @eleven-am/vox-rtc-server, then pass the returned bootstrap to this browser client.

Install

npm install @eleven-am/vox-rtc-client

Example

import { VoxRtcBrowserClient } from "@eleven-am/vox-rtc-client";

const audio = document.querySelector("audio")!;

const client = new VoxRtcBrowserClient({
  sessionEndpoint: "/api/rtc/session",
  audioElement: audio,
  audioDucking: {
    duckVolume: 0.2,
    sustainedVolume: 0.05
  }
});

client.on("state", (state) => {
  console.log(state.status, state.peerConnectionState, state.dataChannelState);
});

client.onClientEvent((message) => {
  console.log("server event", message.event, message.payload);
});

await client.connect();

client.sendEvent({
  event: "ui.select",
  payload: { id: "choice-a" }
});

onClientEvent receives events the backend sent with sendClientEvent. sendEvent sends browser-originated app events to the backend as browser.event.

Session Sources

Use one of:

new VoxRtcBrowserClient({ sessionEndpoint: "/api/rtc/session" });
new VoxRtcBrowserClient({
  session: async () => {
    const response = await fetch("/api/rtc/session", { method: "POST" });
    return response.json();
  }
});
new VoxRtcBrowserClient({
  httpBase: "https://vox.example.com",
  session: {
    sessionId: "...",
    clientToken: "...",
    iceServers: []
  }
});

The first two shapes are preferred for real apps because the backend can keep VOX_API_KEY private.

Audio Ducking

Pass audioDucking: true or an options object to lower the provided audio element while Vox decides whether to interrupt the assistant. This is client-side UX only; Vox still owns VAD, interruption detection, and response cancellation.

By default, ducking follows Vox control events. Your backend should forward the relevant Vox events to the browser, then call client.handleControlEvent(event).

new VoxRtcBrowserClient({
  sessionEndpoint: "/api/rtc/session",
  audioElement: audio,
  audioDucking: {
    threshold: 0.035,
    duckVolume: 0.2,
    sustainedVolume: 0.05,
    sustainedAfterMs: 700,
    releaseDelayMs: 350
  }
});
// from your app's server-events/WebSocket bridge
client.handleControlEvent({
  type: "input_audio_buffer.speech_started"
});

Supported modes:

  • vox: duck only when your app forwards Vox control events. This avoids self-ducking from speaker leakage.
  • local: duck immediately from local microphone level. This is fastest but can self-duck if echo cancellation leaks assistant audio into the mic.
  • hybrid: duck immediately from local microphone level, then hold only if Vox confirms speech through forwarded control events.