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

@metatell/bot-realtime

v2.0.0

Published

Realtime transport helpers for metatell bots. The package provides LiveKit WebRTC transport and a mock adapter for tests and local development.

Downloads

905

Readme

@metatell/bot-realtime

Realtime transport helpers for metatell bots. The package provides LiveKit WebRTC transport and a mock adapter for tests and local development.

Requirements

  • Node.js 20 or later. Node.js 22 is recommended.
  • TypeScript 5 or later for TypeScript projects.

Install

npm install @metatell/bot-realtime
# or
pnpm add @metatell/bot-realtime
# or
yarn add @metatell/bot-realtime

Usage

import { LiveKitAdapter } from '@metatell/bot-realtime'

const adapter = new LiveKitAdapter()

adapter.on((event) => {
  switch (event.type) {
    case 'state':
      console.log('connection state:', event.state)
      break
    case 'data':
      console.log('data received:', event.topic, event.payload)
      break
    case 'participant-joined':
      console.log('participant joined:', event.identity)
      break
  }
})

await adapter.connect({
  url: 'wss://livekit.example.com',
  tokenProvider: async () => getAccessToken(),
  topics: ['control', 'events', 'transcript'],
  audioPublish: {
    sampleRate: 48000,
    channels: 1,
  },
})

await adapter.send('control', JSON.stringify({ action: 'spawn' }))
await adapter.startAudioPublisher()
await adapter.pushPcmFrame(pcmData)

LiveKit Adapter

Use the LiveKit adapter for room voice transport:

const options = {
  url: 'wss://your-livekit-server.com',
  tokenProvider: async () => token,
  topics: ['control', 'events', 'transcript', 'audio'],
  audioPublish: {
    sampleRate: 48000,
    channels: 1,
  },
}

Supported audio sample rates are 16000, 24000, and 48000 Hz. Mono and stereo channels are supported.

Mock Adapter

Use the mock adapter for tests and local development without a LiveKit room:

import { MockAdapter } from '@metatell/bot-realtime'

const mock = new MockAdapter()

mock.simulateConnection()
mock.simulateParticipant('user-123', 'Alice')
mock.simulateData('events', { type: 'test' })

Events

type RealtimeEvent =
  | { type: 'state'; state: ConnectionState }
  | { type: 'data'; topic: string; payload: Uint8Array; from?: string }
  | { type: 'participant-joined'; identity: string; sid: string }
  | { type: 'participant-left'; identity: string; sid: string }
  | { type: 'warning'; code: string; message: string }
  | { type: 'error'; code: string; message: string; cause?: unknown }

License

MIT