Build on the supported package contract
Use absolutejs-voice-example through its supported public entry points.
absolutejs-voice-examplev0.0.1betaDev ToolsThis is a full AbsoluteJS demo app for @absolutejs/voice.
# Private workspace project: ~/abs/examples/voiceThis is a full AbsoluteJS demo app for @absolutejs/voice.
It exposes the same voice intake flow across:
React
Vue
Svelte
Angular
HTML
HTMX
The server uses:
@absolutejs/voice for the WebSocket voice route
@absolutejs/voice-deepgram with Deepgram Flux for STT
@absolutejs/voice-assemblyai as an optional STT fallback provider
route-level phraseHints
ASSEMBLYAI_API_KEY is optional. When present, the backend keeps Deepgram as the primary realtime STT provider and routes to AssemblyAI when Deepgram open/send fails, times out, or is temporarily suppressed by provider health.
Optional LLM routing:
Provider selection is automatic in this order: OpenAI, Anthropic, Gemini, then deterministic fallback. You can force one with VOICE_MODEL_PROVIDER=openai, VOICE_MODEL_PROVIDER=anthropic, VOICE_MODEL_PROVIDER=gemini, or VOICE_MODEL_PROVIDER=deterministic.
Provider model env vars are optional. If no LLM key is present, the server keeps using the deterministic local intake model so the demo still runs with only the voice/STT key.
Then open:
http://localhost:3000/react
http://localhost:3000/vue
http://localhost:3000/svelte
http://localhost:3000/angular
http://localhost:3000/html
http://localhost:3000/htmx
http://localhost:3000/reviews
http://localhost:3000/assistant
The example now follows the same production pattern recommended in @absolutejs/voice itself:
durable runtime storage via createVoiceFileRuntimeStorage(...)
one assistant surface via createVoiceAssistant(...)
provider-neutral model selection through createOpenAIVoiceAssistantModel(...), createAnthropicVoiceAssistantModel(...), and createGeminiVoiceAssistantModel(...)
recipe-driven ops defaults via the assistant support-triage artifact plan
voice({ ops: assistant.ops, onTurn: assistant.onTurn }) to record:
reviews
follow-up tasks
integration events
assistant run analytics from trace events
thin app-specific customization through assistant guardrails, experiments, and model logic
The persisted runtime data lives under:
.voice-runtime/voice-demo/sessions
Every framework page includes the same provider selector. The selected provider is sent to the voice route as ?provider=openai, ?provider=anthropic, ?provider=gemini, or ?provider=deterministic.
The backend routes every assistant turn through createVoiceProviderRouter(...) from @absolutejs/voice:
prefer-selected keeps the user-selected provider first.
configured fallback order is OpenAI, Anthropic, Gemini, then deterministic.
adaptive provider health suppresses providers after provider errors or rate limits.
rate-limit suppressions cool down for 120 seconds in this demo.
successful recovery retries clear active suppression while preserving historical error counts.
Provider status is visible in /assistant and /api/provider-status.
Provider contract readiness is visible in /provider-contracts and /api/provider-contracts. The backend uses the package-level createVoiceProviderContractMatrixPreset("phone-agent", ...) primitive to turn the configured LLM, STT, and TTS providers into one deploy-checkable matrix:
That one primitive proves configured state, required env, declared capabilities, streaming support, fallback coverage, and latency budgets without depending on a hosted dashboard.
Status meanings:
healthy: the provider has a successful recent run and is eligible.
suppressed: the provider is temporarily skipped by the router; suppressionRemainingMs shows the cooldown.
A good end-to-end demo flow is:
Open /demo-checklist for the canonical presentation path.
Open /switching-from-vapi when the buyer asks how Vapi dashboard concepts map to AbsoluteJS-owned primitives and proof URLs.
Open any framework page.
Complete a guided or general voice flow.
Say one of the lifecycle phrases if you want a non-default outcome:
transfer me to billing
escalate this
send it to voicemail
no answer
Open /production-readiness to show the pass/fail control-plane report.
Open /voice/provider-orchestration, /voice/provider-decisions, and /voice/provider-slos to show code-owned provider policy, per-call provider selection reasons, plus LLM/STT/TTS latency, p95, timeout, fallback, and unresolved-error budgets backed by current proof-pack traces.
Open /phone-agent, /carriers, and /telephony-webhook-decisions to show self-hosted carrier readiness.
Open /delivery-sinks to inspect the delivery primitive. The demo writes runtime trace exports into runtimeStorage.traceDeliveries and writes audit evidence for those exports into runtimeStorage.auditDeliveries. Production readiness consumes those same stores, so the UI proves export health without caring whether the sink is file-backed, webhook-backed, S3-backed, SQLite-backed, or Postgres-backed.
Set VOICE_DELIVERY_SINK=file|webhook|s3|postgres|sqlite to change the sink descriptors shown in /delivery-sinks, /ops-console, and /production-readiness. In webhook and s3 modes, the drain endpoints use createVoiceDeliveryRuntimePresetConfig plus createVoiceDeliveryRuntime from the package: VOICE_DELIVERY_WEBHOOK_URL receives signed JSON envelopes, and VOICE_DELIVERY_S3_BUCKET=s3://bucket/prefix writes audit/trace JSON objects through Bun's native S3 client.
Open /delivery-runtime for the package-level worker control plane. It shows audit and trace queue summaries and exposes one manual tick action for both delivery workers.
The current example uses file-backed stores for local demos and mounts:
/audit/deliveries
/traces/deliveries
/api/voice-audit-deliveries/drain
/api/voice-trace-deliveries/drain
Swap the store/worker layer to actually deliver to external infrastructure; keep the voice flow, descriptor, and readiness wiring the same.
Open /data-control to inspect the package-level compliance primitive mounted by the demo. It proves the self-hosted deployment owns its storage posture, redaction defaults, provider-key recommendations, redacted audit exports, retention dry-runs, and guarded deletion flow without depending on a hosted dashboard.
The mounted package routes are:
/data-control
/data-control.json
/data-control.md
/data-control/audit.json
/data-control/audit.md
/data-control/audit.html
/data-control/retention/plan
/data-control/retention/apply
/data-control/retention/apply requires confirm: "apply-retention-policy" in the request body. Use /data-control/retention/plan first for dry-run proof.
Open /ops-recovery to inspect the package-level recovery primitive mounted by the demo. It rolls provider fallback recovery, unresolved provider failures, audit and trace delivery health, handoff delivery health, live-ops interventions, failed sessions, and latency SLOs into one operator-facing report.
The mounted package routes are:
/ops-recovery
/api/voice/ops-recovery
/api/voice/ops-recovery.md
The example now uses published beta versions of @absolutejs/voice and @absolutejs/voice-deepgram, not local file: dependencies.
API keys stay in local environment files only. .env, .env., runtime data, and build outputs are ignored.
The route uses the recommended package path for this demo: Deepgram Flux plus phrase hints and deterministic correction.
The example still keeps its own richer review UI, but runtime review/task/event creation is handled by the core package.
Outcomes
Use absolutejs-voice-example through its supported public entry points.
Hardening checklist
Follow in order
Working example for Run.
cd ~/alex/absolutejs-voice-example
bun install
DEEPGRAM_API_KEY=... ASSEMBLYAI_API_KEY=... bun run devASSEMBLYAI_API_KEY is optional. When present, the backend keeps Deepgram as the primary realtime STT provider and routes to AssemblyAI when Deepgram open/send fails, times out, or is temporarily suppressed by provider health.
OPENAI_API_KEY=... OPENAI_VOICE_MODEL=gpt-4.1-mini bun run dev
ANTHROPIC_API_KEY=... ANTHROPIC_VOICE_MODEL=claude-sonnet-4-5 bun run dev
GEMINI_API_KEY=... GEMINI_VOICE_MODEL=gemini-2.5-flash bun run devScripts declared by this package manifest.