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

voiceai-sdk

v0.2.0

Published

The official TypeScript library for the Slng API

Readme

VoiceAI SDK for TypeScript

NPM version

The official TypeScript SDK for SLNG Voice AI. Use one client for text-to-speech, speech-to-text, and model discovery across SLNG-hosted and provider-backed speech models.

Install

npm install voiceai-sdk

Node 18 or newer is required.

API Key

Create an API key in the SLNG dashboard, then set it in your environment:

export SLNG_API_KEY="zpka_..."
import Slng from 'voiceai-sdk';

const client = new Slng();

You can also pass apiKey directly:

const client = new Slng({ apiKey: process.env.SLNG_API_KEY });

Text To Speech

Generate audio from text and save it locally:

import { writeFile } from 'node:fs/promises';
import Slng from 'voiceai-sdk';

const client = new Slng();

const response = await client.textToSpeech.create('slng/deepgram/aura:2-en', {
  text: 'Hello from SLNG.',
  voice: 'aura-2-thalia-en',
});

await writeFile('hello.wav', Buffer.from(await response.arrayBuffer()));

Use region or 'world-part' when you need explicit routing:

await client.textToSpeech.create('slng/deepgram/aura:2-en', {
  text: 'Hello from Europe.',
  voice: 'aura-2-thalia-en',
  region: 'eu-north-1',
});

Speech To Text

Transcribe a local audio file:

import fs from 'node:fs';
import Slng from 'voiceai-sdk';

const client = new Slng();

const transcript = await client.speechToText.create('slng/deepgram/nova:3-en', {
  audio: fs.createReadStream('meeting.wav'),
});

console.log(transcript.text);

File uploads accept File, Response, fs.ReadStream, or the SDK toFile helper.

Discover Models

The SDK ships with a static catalog snapshot, so agents and scripts can choose valid models without credentials or network calls.

import { getModel, listModels } from 'voiceai-sdk';

const ttsModels = listModels({ service: 'tts', language: 'en' });
const sttModels = listModels({ service: 'stt' });
const aura = getModel('slng/deepgram/aura:2-en');

console.log(ttsModels.map((model) => model.id));
console.log(aura?.deployments);

Model IDs from the catalog can be passed directly to client.textToSpeech.create() or client.speechToText.create().

Discover Voices

Use listVoices() to find voice IDs for a TTS model:

import { listVoices } from 'voiceai-sdk';

const voices = listVoices({
  model: 'slng/deepgram/aura:2-en',
  language: 'en',
});

console.log(voices.map((voice) => `${voice.name}: ${voice.voiceId}`));

listVoices() returns an empty array when a model does not have a cataloged voice list.

Useful voice references:

Streaming

For low-latency WebSocket sessions, use the streaming client:

import { streaming } from 'voiceai-sdk';

const client = new streaming.StreamingClient({
  apiKey: process.env.SLNG_API_KEY!,
});

const session = await client.connectTts('slng/deepgram/aura:2-en');
session.send({
  type: 'init',
  model: 'slng/deepgram/aura:2-en',
  voice: 'aura-2-thalia-en',
});
session.send({ type: 'text', text: 'Streaming text to speech.' });
session.send({ type: 'flush' });

for await (const message of session) {
  console.log(message);
}

Reference