AbsoluteJS

absolutejs-voice-example

absolutejs-voice-examplev0.0.1betaDev Tools

This is a full AbsoluteJS demo app for @absolutejs/voice.

#Installation

BASH
# Private workspace project: ~/abs/examples/voice

#Capabilities

Overview

This is a full AbsoluteJS demo app for @absolutejs/voice.

It exposes the same voice intake flow across:

React

Show 10 more

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

Run

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.

Show 10 more

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

Recommended Pattern

The example now follows the same production pattern recommended in @absolutejs/voice itself:

durable runtime storage via createVoiceFileRuntimeStorage(...)

one assistant surface via createVoiceAssistant(...)

Show 10 more

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

Provider Routing And Failover

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.

Show 10 more

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.

What To Demo

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.

Show 10 more

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.

Delivery Sinks

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.

Show 6 more

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.

Data Control

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

Show 8 more

/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.

Ops Recovery

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

Show 2 more

/api/voice/ops-recovery

/api/voice/ops-recovery.md

Notes

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.

Show 1 more

The example still keeps its own richer review UI, but runtime review/task/event creation is handled by the core package.

Outcomes

What you can build

Build on the supported package contract

Use absolutejs-voice-example through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed absolutejs-voice-example version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical absolutejs-voice-example example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Run

Partial snippet

Working example for Run.

BASH
cd ~/alex/absolutejs-voice-example
bun install
DEEPGRAM_API_KEY=... ASSEMBLYAI_API_KEY=... bun run dev

#Run 2

Partial snippet

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.

BASH
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 dev

#Package commands

Scripts declared by this package manifest.

bun run buildabsolute build
bun run devabsolute dev
bun run formatabsolute prettier --write
bun run lintabsolute eslint
bun run startabsolute start
bun run typecheckabsolute typecheck
Private workspace project
This project is maintained inside the workspace and is not published as a standalone npm package.