Client Libraries
Truebar ships with lightweight SDKs so you can focus on building speech experiences instead of wiring HTTP and WebSocket plumbing by hand. Each client wraps the Truebar pipeline APIs and follows the same authentication model described in the Getting Started guide.
Quick comparison#
| Language | Package | Highlights | Recommended for |
|---|---|---|---|
| Java 21 | JavaTruebarClient | Minimal dependencies, built on java.net.http.HttpClient, ships as a single JAR. | JVM backends, Spring Boot services, Android tooling. |
| JavaScript (ESM) | JsTruebarClient | Browser-friendly WebSocket wrapper, Web Audio helpers for STT, works in modern Chromium/Firefox/Safari. | Web apps that need in-browser capture or playback. |
| Python | Streaming quickstarts | Use the official tutorials’ asyncio/WebSocket snippets to call the API directly. | Scripting, automation, backend services. |
All SDKs are compatible with streaming pipelines (wss://…/api/pipelines/stream) and offline HTTP jobs. If you prefer to call the REST/WebSocket APIs yourself, use the code samples in the streaming guides as a reference.
Java SDK#
The Java client targets Java 21 LTS and relies solely on the standard library. We distribute the artifact as an uber-JAR so you can drop it into any build without managing additional dependencies.
Download#
- Library: JavaTruebarClient-3.0.40.jar
- Sample app: JavaTruebarClientExample-3.0.40.java
From there you can open streaming sessions, submit offline jobs, or inspect history endpoints using the convenience methods provided in the example.
When to use#
- JVM backends that need long-lived streaming sessions (call centre analytics, IVR, etc.).
- Batch workloads that submit large numbers of offline jobs.
If you need other distribution formats (Maven coordinate, shaded jar without example code), reach out to the Vitasis team.
JavaScript SDK#
The JavaScript client is a modern ES module designed for browsers. It exposes helpers for token handling, audio capture, resampling, and WebSocket message flow so you can replicate the streaming STT and streaming TTS guides with minimal boilerplate.
Download#
- Library: JsTruebarClient-0.3.11.js
<script type="module"> import { TruebarClient } from '/path/to/JsTruebarClient-0.3.11.js';
const client = new TruebarClient({ authUrl: import.meta.env.TRUEBAR_AUTH_URL, apiBaseUrl: import.meta.env.TRUEBAR_API_BASE_URL, });
await client.login({ username: import.meta.env.TRUEBAR_USERNAME, password: import.meta.env.TRUEBAR_PASSWORD, });
const stream = await client.openTtsStream({ ttsTag: 'en-US' }); stream.on('audio', (pcmChunk) => playChunk(pcmChunk));</script>Because the SDK is framework-agnostic, you can bundle it with Vite, Next.js, or any other tool that supports ES modules.
When to use#
- Building a browser-based dictation or captioning UI.
- Embedding low-latency synthesis directly in a customer portal.
- Rapid prototyping when you need a reference implementation of the message protocol.
Python examples#
We do not yet ship a packaged Python SDK, but the streaming quickstarts provide fully working asyncio/WebSocket snippets:
These samples handle authentication, WebSocket messaging, and PCM encoding, so you can copy them into your own automation or backend service. Wrap them in your preferred dependency injection or state management pattern to fit larger applications.
Community & support#
- Open an issue in this documentation repository for feedback or feature requests.
- Contact Vitasis support if you need custom tags, private deployments, or packaging formats not listed above.
- Contributions are welcome—provide a short description of the use case so we can keep the SDKs aligned with developer workflows.