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

@thinnest-ai/voice-sdk

v0.1.1

Published

Thinnest AI Voice SDK — add voice AI agents to any web app in 3 lines of code

Readme

@thinnest-ai/voice-sdk

npm license

Add voice AI agents to any web app in 3 lines of code.

Examples

| Example | Description | Run | |---------|-------------|-----| | HTML | Single HTML file, zero build tools | Open index.html in browser | | React | Vite + React + TypeScript | npm install && npm run dev | | Next.js | Next.js 14 App Router | npm install && npm run dev |

Install

npm install @thinnest-ai/voice-sdk

Quick Start

import ThinnestVoice from "@thinnest-ai/voice-sdk";

const voice = new ThinnestVoice("YOUR_API_KEY");

// Start talking to your agent
await voice.start("YOUR_AGENT_ID");

// Listen for transcripts
voice.on("transcript", (msg) => {
  console.log(`${msg.role}: ${msg.text}`);
});

// End the call
voice.stop();

API

new ThinnestVoice(apiKey)

Initialize the SDK with your API key.

const voice = new ThinnestVoice("sk_...");

// Or with options:
const voice = new ThinnestVoice({
  apiKey: "sk_...",
  apiUrl: "https://api.thinnest.ai", // custom endpoint
});

voice.start(agentId, options?)

Start a voice call with an agent. Returns a Call object.

const call = await voice.start("ag_abc123", {
  language: "hi",           // override language
  firstMessage: "Hello!",   // custom greeting
  voiceId: "voice_xyz",     // override TTS voice
});

console.log(call.id);     // "call_abc123"
console.log(call.status); // "active"

voice.stop()

End the current call.

await voice.stop();

voice.setMuted(muted)

Mute or unmute the microphone.

await voice.setMuted(true);  // mute
await voice.setMuted(false); // unmute

voice.isMuted

Check if microphone is muted.

voice.activeCall

Get the current call object (null if no call).

voice.callStatus

Get current status: idle, connecting, ringing, active, ending, ended, error.

voice.getTranscripts()

Get all final transcript messages.

Events

voice.on("call-start", ({ callId, agentId }) => {
  console.log("Call started");
});

voice.on("call-end", ({ callId, duration, reason }) => {
  console.log(`Call ended after ${duration}s: ${reason}`);
});

voice.on("transcript", ({ role, text, isFinal }) => {
  console.log(`${role}: ${text}`);
});

voice.on("speech-start", () => {
  console.log("Agent is speaking");
});

voice.on("speech-end", () => {
  console.log("Agent stopped speaking");
});

voice.on("error", ({ code, message }) => {
  console.error(`Error: ${message}`);
});

voice.on("status-change", ({ status, previousStatus }) => {
  console.log(`${previousStatus} → ${status}`);
});

React Example

import { useState, useEffect, useRef } from "react";
import ThinnestVoice from "@thinnest-ai/voice-sdk";

function VoiceAgent({ agentId }: { agentId: string }) {
  const voiceRef = useRef<ThinnestVoice>();
  const [status, setStatus] = useState("idle");
  const [transcripts, setTranscripts] = useState<any[]>([]);

  useEffect(() => {
    voiceRef.current = new ThinnestVoice("YOUR_API_KEY");

    voiceRef.current.on("status-change", ({ status }) => setStatus(status));
    voiceRef.current.on("transcript", (msg) => {
      if (msg.isFinal) {
        setTranscripts((prev) => [...prev, msg]);
      }
    });

    return () => voiceRef.current?.stop();
  }, []);

  const toggle = async () => {
    if (status === "active") {
      await voiceRef.current?.stop();
    } else {
      await voiceRef.current?.start(agentId);
    }
  };

  return (
    <div>
      <button onClick={toggle}>
        {status === "active" ? "End Call" : "Start Call"}
      </button>
      <p>Status: {status}</p>
      {transcripts.map((t) => (
        <p key={t.id}><b>{t.role}:</b> {t.text}</p>
      ))}
    </div>
  );
}

License

MIT