AbsoluteJS

@absolutejs/voice

Self-hosted voice operations for AbsoluteJS: realtime browser voice, phone-call routes, provider routing, assistants, handoffs, traces, evals, readiness proof, storage adapters, and framework-native UI helpers.

#Install

BASH
bun add @absolutejs/voice @absolutejs/voice-deepgram @absolutejs/voice-elevenlabs elysia

#Entrypoints

EntrypointPurpose
@absolutejs/voiceServer runtime, Elysia plugin, assistants, routing, ops, telephony, proof, storage, and core types.
@absolutejs/voice/angularAngular injectable services for streams, controllers, widgets, and dashboards.
@absolutejs/voice/clientBrowser primitives, stores, Web Components, HTMX bindings, audio players, and dashboard renderers.
@absolutejs/voice/drizzleDrizzle table schemas for runtime storage, memory, handoff, evals, observability, incidents, and proof trends.
@absolutejs/voice/embedEmbeddable browser voice widget ESM entry.
@absolutejs/voice/embed/voice-widget.jsPrebuilt IIFE widget bundle for script-tag embedding.
@absolutejs/voice/reactReact hooks and components for voice widgets, operational dashboards, timelines, and live consoles.
@absolutejs/voice/svelteSvelte store factories and helper creators for voice UI surfaces.
@absolutejs/voice/testingProvider simulators, STT/TTS fixtures, benchmarks, resilience harnesses, and review helpers.
@absolutejs/voice/vueVue components and composables for the same browser and ops surfaces.

#Quickstart

Runnable provider-backed start: set DEEPGRAM_API_KEY, ELEVENLABS_API_KEY, and ELEVENLABS_VOICE_ID, then run this file. It constructs both adapters, starts the server on port 3000, and prints the exact WebSocket URL. The first successful connection receives the greeting; one spoken turn is transcribed and echoed through TTS.

TS
import { Elysia } from "elysia";
import { createVoiceMemoryStore, voice } from "@absolutejs/voice";
import { deepgram } from "@absolutejs/voice-deepgram";
import { elevenlabs } from "@absolutejs/voice-elevenlabs";

const sessions = createVoiceMemoryStore();
const stt = deepgram({ apiKey: process.env.DEEPGRAM_API_KEY! });
const tts = elevenlabs({
	apiKey: process.env.ELEVENLABS_API_KEY!,
	voiceId: process.env.ELEVENLABS_VOICE_ID!
});

new Elysia()
	.use(voice({
		path: "/voice/realtime",
		session: sessions,
		stt,
		tts,
		greeting: "Hi, how can I help?",
		context: async ({ session }) => ({ sessionId: session.id }),
		onTurn: async (_session, turn, api) => {
			await api.say(`You said: ${turn.text}`);
		}
	}))
	.listen(3000);

console.log("voice websocket: ws://localhost:3000/voice/realtime");

#Example App Pattern

The full example app uses one shared channelDefaults() factory and spreads it into browser intake, OpenAI Realtime, and telephony bridge routes. That keeps phrase hints, correction, handoff, live ops, assistant ops, profile switching, session storage, and completion persistence consistent across channels.

TS
import { createVoiceConfiguration, voice } from "@absolutejs/voice";

const channelDefaults = (channelPath: string) => ({
	correctTurn,
	handoff: handoffAdapters.length > 0 ? { adapters: handoffAdapters, deliveryQueue } : undefined,
	liveOps: liveOpsRuntime,
	onTurn: contractAwareOnTurn,
	ops: assistant.ops,
	preset: "reliability" as const,
	profileSwitchGuard: createProfileSwitchGuard(channelPath),
	session: sessionStore,
	onComplete: async ({ session }) => persistIntake(buildSavedIntake(session)),
	phraseHints: async ({ context, sessionId }) => {
		await rememberSessionRoutingMode({ context, sessionId });
		return VOICE_DEMO_PHRASE_HINTS;
	}
});

export const voiceConfig = createVoiceConfiguration({
	...channelDefaults("/voice/intake"),
	path: "/voice/intake",
	stt,
	tts,
	htmx: renderSavedIntakeHtmx
});

app.use(voice(voiceConfig));

#Feature Map

Runtimevoice(), createVoiceSession(), adapter contracts, reconnect, turn detection, filler audio, barge-in, conditioning, noise suppression.
AssistantscreateVoiceAssistant(), defineVoiceAssistant(), agents, squads, model adapters, MCP, RAG, named Vapi-compatible tools.
Conversation flowspathways, pathway compiler/runtime/generator/visualizer, slot collector, IVR plan, outcome recipes, workflow contracts, and tool contracts.
TelephonyTwilio, Telnyx, Plivo, webhooks, carrier matrices, media proof, campaign dialers, phone agents, DTMF, AMD, hold audio, whisper channel, and backchannel.
Outbound operationscampaigns, templates, controls, DNC registry, calling windows, call quotas, no-show prediction, booking flow, calendar slots, and reminder scheduling.
Business intelligencecaller memory, assistant memory, CRM linking/logging/contracts, cost accounting, cost prediction, post-call analysis, scorecards, transcript annotation, and quality drift detection.
Operationsaudit trail, ops runtime, live ops, monitors, incidents, delivery sinks, recovery, webhooks, operations records.
Proofproduction readiness, SLOs, channel contracts, provider contracts, competitive coverage, media proof, simulation suites, multilingual STT, proof trends, real-call evidence.
UIbrowser controllers, Web Components, HTMX, React, Vue, Svelte, Angular, dashboards, timelines, call player, live-agent console.

#Full Sweep Feature Map

Feature FamilyIncluded Surfaces
Agent and workflow logicAssistants, agents, squads, model routing, tools, RAG, MCP, Vapi import, pathways, pathway compiler/runtime/generator/visualizer, pathway slot collector, IVR plans, outcome recipes, workflow contracts, and tool contracts.
Voice runtimeReconnect, barge-in, cached TTS, filler audio, audio conditioning, noise suppression, semantic turns, turn profiles, correction, scribe, recording, redaction, prompt-injection guard, guardrails, and zero-data-retention controls.
Telephony and outboundTwilio, Telnyx, Plivo, phone agents, phone provisioning, carrier matrices, media proof, webhook verification, DTMF, AMD, hold audio, whisper channel, backchannel, live coach, supervisor presence, campaigns, dialers, DNC registry, calling windows, call quotas, no-show prediction, reminders, and telephony outcome policy.
Business systemsCaller memory, assistant memory, CRM caller linking, CRM call logging, CRM contracts, calendar adapters, calendar slots, booking flows, variable analytics, cost accounting, cost prediction, post-call analysis, post-call surveys, transcript annotation, call disposition, call scorecards, AI scorecards, calibration, and quality drift detection.
Production proofProduction readiness, readiness profiles, proof assertions, proof runner, proof packs, proof trends, provider health, provider orchestration, provider decision traces, provider router traces, provider SLOs, provider stack recommendations, provider contract matrices, platform coverage, competitive coverage, realtime provider contracts, reconnect contracts, multilingual proof, resilience, diagnostics, trace timelines, incident bundles, and operations records.
Client and framework surfacesCore browser client, microphone capture, duplex controller, reactive sources, HTMX, Web Components, embed bundle, React, Vue, Svelte, Angular, dashboards, live call viewer, live agent console, call player, cost dashboard, provider dashboards, replay timeline, proof trends, turn quality, turn latency, routing status, session observability, and session snapshots.
Storage and deliveryMemory, file, S3, SQLite, Postgres, Drizzle runtime storage, recording stores, audit stores, trace stores, ops stores, delivery sinks, audit delivery, trace delivery, observability export, OpenTelemetry export, retention, data control, and webhook fanout.
Testing ecosystemCore testing helpers, fixtures, provider simulators, I/O simulators, STT/TTS testing, duplex testing, resilience testing, accuracy benchmarks, session benchmarks, telephony tests, corrected transcript tests, voice-tester scenarios, Twilio WS transport, Discord transport, outbound Twilio transport, Aura TTS, Deepgram STT, LLM caller decisions, and μ-law utilities.

Current package surface

What ships today

@absolutejs/voicev0.0.22-beta.665 · betaVoice & MedianpmSource
12entry points502symbols

Import surface · click to copy

80 symbols
voiceexportPermalinkSource
TS
voice
Exported from @absolutejs/voice

Outcomes

What you can build

Own the realtime voice stack

Build browser and phone voice agents with streaming STT, model routing, tools, RAG, TTS, telephony, framework helpers, fallback, reconnection, and session storage.

Operate production voice workflows

Run support, scheduling, outreach, meeting-recording, and compliance-sensitive workflows with simulations, proof packs, live monitoring, operator controls, and post-call analysis.

Hardening checklist

Production guidance

Prove readiness before live trafficComplete the readiness checklist for latency budgets, provider fallback, telephony, storage, delivery, compliance, observability, simulations, multilingual quality, and operator recovery.

Follow in order

Troubleshooting path

1
A call sounds or behaves incorrectly
Follow the default debug path through session state, media ingress, STT, turn timing, model routing, tools, TTS, delivery, telephony, traces, and replay before swapping providers.