Installation
@types/kugelaudio to
install, and no extra configuration is required.
Module systems
The SDK ships both an ESM and a CommonJS build, each with its own type declarations, so it works from either module system without a bundler or transpiler.import KugelAudio from 'kugelaudio' is a type error.
Types resolve correctly under every TypeScript moduleResolution setting —
node, node16, nodenext, and bundler — for the main entry point and for
the kugelaudio/livekit subpath.
Quick Start
Pre-connecting for Low Latency
For latency-sensitive applications, pre-establish the WebSocket connection at startup to keep the handshake out of your first TTS request — see Latency.Using the Factory Method (Recommended)
Manual Connection
Complete Example
Browser Support
The SDK works in modern browsers with WebSocket support. For Node.js, ensure you have a WebSocket implementation available.Next Steps
- Client Configuration — options, authentication modes, regions, lifecycle
- Generate Audio — one-shot generation, streamed output, word timestamps, utilities
- Text Normalization — numbers, dates, languages, spell tags
- Streaming Sessions — LLM integration, session reuse, barge-in, multi-context
- Voices — list, create, and manage voices
- Dictionaries — per-project pronunciation and replacement lists
- Types & Errors — error classes and the full TypeScript reference