AbsoluteJS

@absolutejs/voice-elevenlabs

@absolutejs/voice-elevenlabsv0.0.26betaVoice & Media

ElevenLabs text-to-speech adapter for @absolutejs/voice

#Installation

BASH
bun add @absolutejs/voice-elevenlabs

#Capabilities

Overview

ElevenLabs text-to-speech adapter for @absolutejs/voice.

Setup

The adapter uses ElevenLabs' official streaming text-to-speech endpoint and emits normalized audio events with PCM chunks.

If you need a warm persistent TTS session for lower turn startup latency, you can opt into ElevenLabs' WebSocket transport:

What It Maps

HTTP chunked audio stream -> audio

warm WebSocket stream-input session -> audio

request failures -> normalized error

Show 2 more

adapter close -> normalized close

This adapter currently supports PCM output formats for compatibility with @absolutejs/voice audio events.

Options

Supported options include:

apiKey

voiceId

Show 9 more

modelId

outputFormat

languageCode

voiceSettings

seed

enableLogging

optimizeStreamingLatency

transport

websocket

API Key

Set ELEVENLABS_API_KEY in your runtime environment, or pass the key explicitly in the adapter config.

ElevenLabs references used for this adapter design:

https://elevenlabs.io/docs/api-reference/text-to-speech

Show 2 more

https://elevenlabs.io/docs/api-reference/streaming

https://elevenlabs.io/docs/capabilities/text-to-speech

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/voice-elevenlabs through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/voice-elevenlabs 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-elevenlabs example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Setup

Partial snippet

Working example for Setup.

TS
import { elevenlabs } from "@absolutejs/voice-elevenlabs";

const tts = elevenlabs({
  apiKey: process.env.ELEVENLABS_API_KEY!,
  voiceId: "JBFqnCBsd6RMkjVDRZzb",
  modelId: "eleven_flash_v2_5",
  outputFormat: "pcm_16000",
});

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/voice-elevenlabs@absolutejs/voice-elevenlabs/manifest@absolutejs/voice-elevenlabs/manifest.json

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build ./src/index.ts ./src/manifest.ts --outdir dist --target bun --external @absolutejs/manifest --external '@absolutejs/manifest/*' --external @absolutejs/voice --external '@absolutejs/voice/*' --external @sinclair/typebox --external '@sinclair/typebox/*' && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts
bun run formatprettier --write "./**/*.{js,ts,json,md}"
bun run testbun test
bun run typecheckbun run tsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

7 symbols
elevenlabsexportPermalinkSource
TS
elevenlabs
Exported from @absolutejs/voice-elevenlabs