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

@onebudd/onebudd-sdk

v1.0.0

Published

OneBudd STS SDK - Real-time voice AI conversations

Readme

@onebud/onebudd-sdk

JavaScript/TypeScript SDK for OneBudd real-time voice AI.

npm TypeScript

Installation

npm install @onebud/onebudd-sdk
# or
yarn add @onebud/onebudd-sdk
# or
pnpm add @onebud/onebudd-sdk

Quick Start

import { OneBuddClient } from '@onebud/onebudd-sdk';

const client = new OneBuddClient('pk_test_xxx');

// Connect
const session = await client.startSession();
console.log('Connected:', session.id);

// Listen for events
client.on('audio', (bytes) => {
  // bytes is Uint8Array - play through Web Audio API
  playAudio(bytes);
});

client.on('transcript', ({ role, text, is_final }) => {
  console.log(`${role}: ${text}`);
});

// Send text (skips speech recognition)
client.sendMessage('Hello!');

// Or send audio (PCM 16kHz mono 16-bit)
client.sendAudio(audioBytes);

// End session
client.endSession();

Configuration

const client = new OneBuddClient('pk_xxx', {
  baseUrl: 'wss://api.onebudd.com',  // WebSocket URL
  autoReconnect: true,                // Auto-reconnect on disconnect
  maxReconnectAttempts: 5,            // Max reconnection attempts
  reconnectDelayMs: 1000,             // Base delay (exponential backoff)
});

API Reference

Methods

| Method | Description | |--------|-------------| | startSession() | Connect and start a new session | | endSession() | End the current session | | sendAudio(chunk) | Send raw PCM audio (Uint8Array) | | sendAudioWithMeta(chunk, seq?) | Send audio with metadata | | sendMessage(text) | Send text (bypasses STT) | | cancel(target?) | Cancel active operations |

Events

| Event | Payload | Description | |-------|---------|-------------| | audio | Uint8Array | TTS audio bytes | | transcript | { role, text, is_final } | Transcription | | state_change | { from, to, trigger } | Pipeline state | | error | { code, message, fatal } | Error occurred | | connected | SessionCapabilities | Session ready | | disconnected | { reason } | Connection lost | | response_correction | { original, corrected } | After barge-in |

Properties

| Property | Type | Description | |----------|------|-------------| | isConnected | boolean | Connection status | | sessionId | string \| null | Current session ID | | capabilities | SessionCapabilities \| null | Server capabilities |


Browser Usage

<script type="module">
  import { OneBuddClient } from 'https://cdn.jsdelivr.net/npm/@onebud/onebudd-sdk';
  
  const client = new OneBuddClient('pk_xxx');
  // ...
</script>

Capturing Microphone Audio

const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const audioContext = new AudioContext({ sampleRate: 16000 });
const source = audioContext.createMediaStreamSource(stream);
const processor = audioContext.createScriptProcessor(4096, 1, 1);

processor.onaudioprocess = (e) => {
  const float32 = e.inputBuffer.getChannelData(0);
  const int16 = new Int16Array(float32.length);
  for (let i = 0; i < float32.length; i++) {
    int16[i] = Math.max(-32768, Math.min(32767, float32[i] * 32768));
  }
  client.sendAudio(new Uint8Array(int16.buffer));
};

source.connect(processor);
processor.connect(audioContext.destination);

Node.js Usage

import { OneBuddClient } from '@onebud/onebudd-sdk';
import { createReadStream } from 'fs';

const client = new OneBuddClient('pk_xxx');
await client.startSession();

// Stream audio file
const stream = createReadStream('audio.pcm');
stream.on('data', (chunk) => {
  client.sendAudio(new Uint8Array(chunk));
});

Error Handling

client.on('error', ({ code, message, fatal }) => {
  console.error(`Error [${code}]: ${message}`);
  if (fatal) {
    // Connection will be closed
  }
});

// Error codes
// AUTH_FAILED, RATE_LIMITED, INVALID_MESSAGE, SESSION_NOT_FOUND, etc.

TypeScript

Full type definitions included:

import type {
  SessionCapabilities,
  TranscriptPayload,
  ErrorPayload,
  StateChangePayload,
} from '@onebud/onebudd-sdk';

License

MIT