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

@dtelecom/server-sdk-node

v0.2.5

Published

Node.js RTC SDK for dTelecom — WebRTC participant for AI bots

Readme

@dtelecom/server-sdk-node

Node.js RTC SDK for dTelecom — join rooms as a WebRTC participant for AI bots.

Features

  • WebRTC participant — join dTelecom rooms as a bot
  • Audio receive — subscribe to remote audio as PCM16 streams (16kHz for STT)
  • Audio send — publish PCM16 audio as Opus (from TTS or any source)
  • Data channels — send/receive messages via reliable or lossy channels
  • Pure TypeScript WebRTC — uses werift (no native WebRTC deps)
  • Opus codec — uses @discordjs/opus (native libopus bindings)

Install

npm install @dtelecom/server-sdk-node @discordjs/opus

Quick Start: Echo Bot

import { Room, AudioSource, AudioStream, AudioFrame, LocalAudioTrack } from '@dtelecom/server-sdk-node';

const room = new Room();
await room.connect('wss://my.dtelecom.org', token);

// Create audio output
const source = new AudioSource(16000, 1);
const track = LocalAudioTrack.createAudioTrack('echo', source);
await room.localParticipant.publishTrack(track);

// Echo received audio back
room.on('trackSubscribed', async (remoteTrack, pub, participant) => {
  const stream = remoteTrack.createStream(16000, 1);
  for await (const frame of stream) {
    await source.captureFrame(frame); // echo back
  }
});

Architecture

@dtelecom/server-sdk-node
├── SignalClient          WebSocket + protobuf to SFU
├── RTCEngine             2 PeerConnections (publisher + subscriber)
├── Room                  participant management, events
├── LocalParticipant      publish tracks + data
├── RemoteParticipant     subscribed tracks
├── AudioSource           PCM16 → Opus → RTP → publish
├── AudioStream           subscribe → RTP → Opus → PCM16
└── DataChannel           reliable + lossy messaging

API

Room

const room = new Room();
await room.connect(url, token, { autoSubscribe: true });

room.on('participantConnected', (participant) => { });
room.on('trackSubscribed', (track, publication, participant) => { });
room.on('dataReceived', (data, participant, kind, topic) => { });
room.on('disconnected', (reason) => { });

await room.disconnect();

Audio

// Publish audio
const source = new AudioSource(16000, 1);
const track = LocalAudioTrack.createAudioTrack('bot-audio', source);
await room.localParticipant.publishTrack(track);

const frame = new AudioFrame(pcm16Data, 16000, 1, samplesPerChannel);
await source.captureFrame(frame);

// Receive audio
room.on('trackSubscribed', async (remoteTrack) => {
  const stream = remoteTrack.createStream(16000, 1);
  for await (const frame of stream) {
    // frame.data = Int16Array (PCM16, 16kHz, mono)
  }
});

Data Channels

import { DataPacket_Kind } from '@dtelecom/server-sdk-node';

await room.localParticipant.publishData(
  new TextEncoder().encode('hello'),
  { kind: DataPacket_Kind.RELIABLE, topic: 'chat' }
);

room.on('dataReceived', (data, participant, kind, topic) => {
  console.log(new TextDecoder().decode(data));
});

Examples

# Echo bot — echoes received audio back
npx tsx examples/echo-bot.ts --room test

# Record audio — saves remote audio to PCM file
npx tsx examples/receive-audio.ts --room test --output recording.pcm

# Play audio — sends PCM file into room
npx tsx examples/send-audio.ts --room test --input hello.pcm

Dependencies

| Package | Purpose | Native? | |---|---|---| | werift | WebRTC (ICE, DTLS, SRTP) | No (pure TS) | | @discordjs/opus | Opus encode/decode | Yes (libopus) | | ws | WebSocket client | No | | protobufjs | Protobuf encode/decode | No |

License

Apache-2.0