← All posts
· 5 min read

Introducing the LeanVox Node.js SDK: Text-to-Speech for TypeScript Developers

The official LeanVox Node.js/TypeScript SDK is here. Full type safety, zero runtime dependencies, streaming, voice cloning, and multi-speaker dialogue — npm install leanvox.

nodejstypescriptsdkttsdeveloper-tools

Two SDKs in one day. The LeanVox Node.js/TypeScript SDK is live.

npm install leanvox
import { Leanvox } from 'leanvox';

const client = new Leanvox();
const result = await client.generate({ text: 'Hello from Node!' });
console.log(result.audioUrl);

Three lines. Full TypeScript types. Zero runtime dependencies.

Why a Node.js SDK?

Our Python SDK launched this morning and the response was clear: developers want first-class support in their stack. Node.js and TypeScript power a huge chunk of modern web apps, APIs, and serverless functions. If you're building with Next.js, Express, Fastify, or Deno — this is for you.

What You Get

Generate speech

const result = await client.generate({
  text: 'Welcome to the future of voice.',
  model: 'pro',
  voice: 'af_heart',
  speed: 1.1,
});
console.log(result.audioUrl); // CDN URL, ready to use

Stream audio in real-time

const stream = await client.stream({ text: 'This streams in real-time...' });
for await (const chunk of stream) {
  // Process audio chunks as they arrive
  process.stdout.write(chunk);
}

Multi-speaker dialogue

const episode = await client.dialogue({
  model: 'pro',
  lines: [
    { text: 'Welcome to the show!', voice: 'emma' },
    { text: 'Great to be here.', voice: 'james' },
  ],
  gapMs: 400,
});

Voice cloning

import { readFileSync } from 'fs';

const voice = await client.voices.clone({
  name: 'My Voice',
  audio: readFileSync('sample.wav'),
});
await client.voices.unlock(voice.voiceId);

const result = await client.generate({
  text: 'This is my cloned voice!',
  voice: voice.voiceId,
});

Voice design from prompt

const narrator = await client.voices.design({
  name: 'Epic Narrator',
  prompt: 'Deep, warm male voice with gravitas',
});

Built for TypeScript

This isn't a JavaScript SDK with types bolted on. It's TypeScript-first:

  • Full type inference — every response is typed, IDE autocompletion everywhere
  • ESM + CJS — works in any Node.js project, bundler, or serverless runtime
  • Zero runtime dependencies — uses native fetch (Node 18+)
  • Async/await — no callbacks, no promises chains
  • Streaming via async iteratorsfor await just works
  • Auto-retry — exponential backoff on 5xx, respects rate limits

Both SDKs, One Package Name

We kept it simple:

LanguageInstallPackage
Pythonpip install leanvoxPyPI
Node.js/TSnpm install leanvoxnpm

Same package name, same API design philosophy, same 3-line quickstart.

Get Started

npm install leanvox
import { Leanvox } from 'leanvox';

const client = new Leanvox();
const result = await client.generate({ text: "Let's build something amazing." });
console.log(result.audioUrl);

Three lines. Now go build something that talks.

GitHub · npm · Get your API key


Try LeanVox free

$0.50 in free credits. No credit card required. Start generating speech in 30 seconds.

Get started free →