Skip to content

docs: expand coverage with framework quick-starts, generation hooks, and realtime voice#426

Merged
AlemTuzlak merged 1 commit into
mainfrom
docs/expand-coverage
Apr 7, 2026
Merged

docs: expand coverage with framework quick-starts, generation hooks, and realtime voice#426
AlemTuzlak merged 1 commit into
mainfrom
docs/expand-coverage

Conversation

@AlemTuzlak
Copy link
Copy Markdown
Contributor

@AlemTuzlak AlemTuzlak commented Apr 7, 2026

Summary

  • Added Quick Start guides for Vue, Svelte, and server-only Node.js (renamed existing to "Quick Start: React")
  • Added API reference pages for @tanstack/ai-vue and @tanstack/ai-svelte
  • Added ElevenLabs adapter documentation (realtime voice)
  • Added Generation Hooks guide covering useGenerateImage, useGenerateSpeech, useTranscription, useSummarize, useGenerateVideo with complete React examples
  • Added Thinking & Reasoning guide for ThinkingPart rendering and provider config (Anthropic extended thinking, OpenAI reasoning)
  • Expanded Realtime Voice Chat guide with VAD modes, audio visualization API, and ElevenLabs as alternative provider
  • Added cross-link callouts in image-generation, text-to-speech, and streaming pages

Test plan

  • pnpm test:docs passes (243 files, 0 broken links)
  • pnpm run sync-docs-config generates correct sidebar with all new pages
  • Verify pages render correctly on tanstack.com/ai

Summary by CodeRabbit

Release Notes

  • Documentation
    • Added ElevenLabs adapter integration guide with server token generation and client connection setup
    • Added Vue and Svelte framework quick-start guides with complete examples
    • Added server-only Node.js setup guide for backend implementations
    • Added thinking and reasoning content documentation for supported AI models
    • Added generation hooks documentation for image, speech, transcription, and summarization
    • Enhanced realtime chat documentation with audio visualization and adapter options
    • Updated quick-start navigation with framework-specific entry points

… ElevenLabs adapter, and expanded realtime voice guide

New pages:
- Quick Start guides for Vue, Svelte, and server-only Node.js
- @tanstack/ai-vue and @tanstack/ai-svelte API references
- ElevenLabs realtime voice adapter documentation
- Generation hooks guide (useGenerateImage, useGenerateSpeech, etc.)
- Thinking & Reasoning content guide (ThinkingPart, extended thinking)

Expanded:
- Realtime voice guide with VAD modes, audio visualization, ElevenLabs
- Renamed existing quick-start to "Quick Start: React" with cross-links

Cross-links added to image-generation, text-to-speech, and streaming pages.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

This pull request adds comprehensive documentation across multiple areas: new framework-specific quick-start guides (Vue, Svelte, server-only), API documentation for Vue and Svelte integrations, new feature documentation for thinking/reasoning and generation hooks, ElevenLabs adapter documentation, and updates to existing guides with cross-references and enhanced VAD explanations.

Changes

Cohort / File(s) Summary
Framework Quick Starts
docs/getting-started/quick-start-vue.md, docs/getting-started/quick-start-svelte.md, docs/getting-started/quick-start-server.md
Added platform-specific quick-start guides for Vue 3, Svelte 5, and Node.js server setups, including installation, server routing, client component/factory examples, environment variables, and framework-specific notes.
Framework API Documentation
docs/api/ai-vue.md, docs/api/ai-svelte.md
New API reference pages documenting Vue composables (useChat, useGeneration, variants) and Svelte factory functions (createChat, createGeneration, variants) with options, return shapes, and usage examples.
New Feature Documentation
docs/chat/thinking-content.md, docs/media/generation-hooks.md
Added comprehensive guides for thinking/reasoning support (provider-specific config, rendering patterns) and generation hooks API (shared surface area, framework variants, and media-type examples).
Adapter Documentation
docs/adapters/elevenlabs.md
Documented ElevenLabs voice adapter including token generation (realtimeToken(), elevenlabsRealtimeToken()), client connection setup (elevenlabsRealtime()), client tools, configuration options, and limitations.
Navigation & Config
docs/config.json, docs/getting-started/quick-start.md
Updated navigation structure to organize framework-specific quick starts, new API entries for Vue/Svelte, new sections for thinking content and generation hooks; updated React quick-start title and callout.
Enhanced Existing Documentation
docs/chat/streaming.md, docs/media/image-generation.md, docs/media/text-to-speech.md, docs/media/realtime-chat.md
Added tip callouts linking to generation hooks, expanded VAD mode documentation with improved table structure and examples, added ElevenLabs adapter integration section, and updated audio visualization patterns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~18 minutes

Poem

🐰 Hoppy docs hop and bounce all around,
Vue, Svelte, servers—we've covered all ground!
From thinking thoughts to voices that speak,
ElevenLabs shines for those seeking the sleek.
New guides light the way, so hopper than ever! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is well-structured with a clear summary section detailing all major additions and an explicit test plan. However, the checklist items from the required template are not addressed. Complete the checklist by confirming the Contributing guide was followed and that pnpm run test:pr was executed locally, or clarify if these checks are not applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main documentation additions: framework quick-starts, generation hooks, and realtime voice support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/expand-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 7, 2026

View your CI Pipeline Execution ↗ for commit 99f485b

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 8s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-07 12:42:46 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 7, 2026

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/@tanstack/ai@426

@tanstack/ai-anthropic

npm i https://pkg.pr.new/@tanstack/ai-anthropic@426

@tanstack/ai-client

npm i https://pkg.pr.new/@tanstack/ai-client@426

@tanstack/ai-code-mode

npm i https://pkg.pr.new/@tanstack/ai-code-mode@426

@tanstack/ai-code-mode-skills

npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@426

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/@tanstack/ai-devtools-core@426

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@426

@tanstack/ai-event-client

npm i https://pkg.pr.new/@tanstack/ai-event-client@426

@tanstack/ai-fal

npm i https://pkg.pr.new/@tanstack/ai-fal@426

@tanstack/ai-gemini

npm i https://pkg.pr.new/@tanstack/ai-gemini@426

@tanstack/ai-grok

npm i https://pkg.pr.new/@tanstack/ai-grok@426

@tanstack/ai-groq

npm i https://pkg.pr.new/@tanstack/ai-groq@426

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@426

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/@tanstack/ai-isolate-node@426

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@426

@tanstack/ai-ollama

npm i https://pkg.pr.new/@tanstack/ai-ollama@426

@tanstack/ai-openai

npm i https://pkg.pr.new/@tanstack/ai-openai@426

@tanstack/ai-openrouter

npm i https://pkg.pr.new/@tanstack/ai-openrouter@426

@tanstack/ai-preact

npm i https://pkg.pr.new/@tanstack/ai-preact@426

@tanstack/ai-react

npm i https://pkg.pr.new/@tanstack/ai-react@426

@tanstack/ai-react-ui

npm i https://pkg.pr.new/@tanstack/ai-react-ui@426

@tanstack/ai-solid

npm i https://pkg.pr.new/@tanstack/ai-solid@426

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/@tanstack/ai-solid-ui@426

@tanstack/ai-svelte

npm i https://pkg.pr.new/@tanstack/ai-svelte@426

@tanstack/ai-vue

npm i https://pkg.pr.new/@tanstack/ai-vue@426

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/@tanstack/ai-vue-ui@426

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@426

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/@tanstack/react-ai-devtools@426

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@426

commit: 99f485b

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/adapters/elevenlabs.md`:
- Around line 196-210: Update the realtime-chat.md docs to clearly mark VAD
examples and APIs (vadMode, setVADMode(), semanticEagerness, updateSession()) as
OpenAI-specific: add a note near the VAD examples stating these calls work only
with the OpenAI Realtime adapter and cannot be used with the ElevenLabs adapter;
also mention ElevenLabs uses ElevenLabsVADConfig and server-side thresholds and
that its adapter logs "ElevenLabs does not support runtime session updates.
Configure at connection time." to guide readers.

In `@docs/media/realtime-chat.md`:
- Around line 475-490: Standardize the token endpoint and expand the ElevenLabs
docs: change the example in realtime-chat.md to use the same endpoint path as
docs/adapters/elevenlabs.md (use /api/realtime-token), add a short snippet
showing how to pass adapter options to elevenlabsRealtime (mention
connectionMode and debug) when calling useRealtimeChat, and replace the vague
"overrides" note with a concrete server-side example that references
realtimeToken and elevenlabsRealtimeToken and shows passing overrides (voiceId,
systemPrompt, firstMessage, language) at token generation time; locate and
update the examples around useRealtimeChat, elevenlabsRealtime, realtimeToken,
and elevenlabsRealtimeToken.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25eb8c2a-7683-471c-9a02-6ed6d626bace

📥 Commits

Reviewing files that changed from the base of the PR and between 49ade0a and 99f485b.

📒 Files selected for processing (14)
  • docs/adapters/elevenlabs.md
  • docs/api/ai-svelte.md
  • docs/api/ai-vue.md
  • docs/chat/streaming.md
  • docs/chat/thinking-content.md
  • docs/config.json
  • docs/getting-started/quick-start-server.md
  • docs/getting-started/quick-start-svelte.md
  • docs/getting-started/quick-start-vue.md
  • docs/getting-started/quick-start.md
  • docs/media/generation-hooks.md
  • docs/media/image-generation.md
  • docs/media/realtime-chat.md
  • docs/media/text-to-speech.md

Comment on lines +196 to +210
## Differences from OpenAI Realtime

ElevenLabs and OpenAI take different approaches to realtime voice:

| | ElevenLabs | OpenAI |
|---|---|---|
| **Configuration** | Agent-based. Configure voice, personality, and knowledge in the ElevenLabs dashboard or via `overrides` at token time. | Session-based. Configure `instructions`, `voice`, `temperature`, etc. per session via `useRealtimeChat` options. |
| **Token type** | Signed WebSocket URL (valid 30 minutes) | Ephemeral API token (valid ~10 minutes) |
| **Transport** | WebSocket (default) or WebRTC | WebRTC |
| **Audio handling** | `@11labs/client` SDK manages audio capture and playback automatically | TanStack AI manages WebRTC peer connection and audio tracks |
| **VAD** | Handled by ElevenLabs server-side | Supports `server`, `semantic`, and `manual` modes |
| **Runtime updates** | Session config is set at creation time and cannot be changed mid-session | Supports `updateSession()` for mid-session config changes |
| **Image input** | Not supported | Supported via `sendImage()` |
| **Time domain data** | Not available from the SDK | Available for waveform visualizations |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if ElevenLabs adapter implements VAD-related features

echo "=== Checking for vadMode support ==="
rg -n "vadMode" --type=ts -g '*elevenlabs*' -C3

echo -e "\n=== Checking for setVADMode support ==="
rg -n "setVADMode" --type=ts -g '*elevenlabs*' -C3

echo -e "\n=== Checking for semanticEagerness support ==="
rg -n "semanticEagerness" --type=ts -g '*elevenlabs*' -C3

echo -e "\n=== Checking ElevenLabs adapter interface ==="
ast-grep --pattern $'interface $_ {
  $$$
  vadMode
  $$$
}'

Repository: TanStack/ai

Length of output: 18168


🏁 Script executed:

# Find the ElevenLabs adapter implementation
find . -type f -name "*elevenlabs*" | head -20

Repository: TanStack/ai

Length of output: 84


🏁 Script executed:

# Search for the ElevenLabs adapter main file
fd -i elevenlabs --type f

Repository: TanStack/ai

Length of output: 82


🏁 Script executed:

# Look at the realtime-chat.md documentation to understand adapter-specific features
cat -n docs/media/realtime-chat.md | sed -n '175,230p'

Repository: TanStack/ai

Length of output: 1867


🏁 Script executed:

# Check the ElevenLabs adapter interface/type definitions
rg -n "elevenlabs" --type=ts -i -l

Repository: TanStack/ai

Length of output: 645


🏁 Script executed:

# Check the ElevenLabs adapter implementation for VAD support
cat packages/typescript/ai-elevenlabs/src/realtime/adapter.ts

Repository: TanStack/ai

Length of output: 8411


🏁 Script executed:

# Check the ElevenLabs types definition
cat packages/typescript/ai-elevenlabs/src/realtime/types.ts

Repository: TanStack/ai

Length of output: 1513


🏁 Script executed:

# Check if there's an OpenAI adapter to compare
fd -i openai --type f | grep -i realtime

Repository: TanStack/ai

Length of output: 37


Clarify that VAD features in realtime-chat.md documentation are OpenAI-specific.

The elevenlabs.md comparison table is accurate—ElevenLabs does not support vadMode, setVADMode(), or semanticEagerness. However, the realtime-chat.md documentation (lines 175–206) shows VAD examples without clearly stating these features are OpenAI-only.

The ElevenLabs adapter explicitly logs warnings when updateSession() is called: "ElevenLabs does not support runtime session updates. Configure at connection time." VAD in ElevenLabs is configured via ElevenLabsVADConfig with server-side thresholds and cannot be changed mid-session.

Update realtime-chat.md to clarify that VAD mode switching examples apply only to OpenAI Realtime, or add a note stating which features are adapter-specific.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/adapters/elevenlabs.md` around lines 196 - 210, Update the
realtime-chat.md docs to clearly mark VAD examples and APIs (vadMode,
setVADMode(), semanticEagerness, updateSession()) as OpenAI-specific: add a note
near the VAD examples stating these calls work only with the OpenAI Realtime
adapter and cannot be used with the ElevenLabs adapter; also mention ElevenLabs
uses ElevenLabsVADConfig and server-side thresholds and that its adapter logs
"ElevenLabs does not support runtime session updates. Configure at connection
time." to guide readers.

Comment on lines +475 to +490
## Using ElevenLabs

TanStack AI supports [ElevenLabs](../adapters/elevenlabs) as an alternative realtime voice provider. The client API is identical — swap the adapter and token function:

```typescript
import { useRealtimeChat } from '@tanstack/ai-react'
import { elevenlabsRealtime } from '@tanstack/ai-elevenlabs'

const { status, messages, connect, disconnect } = useRealtimeChat({
getToken: () => fetch('/api/elevenlabs-token').then(r => r.json()),
adapter: elevenlabsRealtime(),
})
```

> **Note:** ElevenLabs uses agent-based configuration — voice and system prompt are set in the ElevenLabs dashboard or via token overrides. See the [ElevenLabs adapter page](../adapters/elevenlabs) for setup details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Inconsistent endpoint path and missing adapter options documentation.

Three documentation gaps create confusion for developers implementing ElevenLabs:

  1. Endpoint path mismatch - This page uses /api/elevenlabs-token (line 484), but docs/adapters/elevenlabs.md uses /api/realtime-token (lines 82, 165, 223). Standardize on one path across both documentation files.

  2. Missing adapter options - elevenlabsRealtime() supports connectionMode and debug options (documented in docs/adapters/elevenlabs.md lines 193-194), but these options are not mentioned here.

  3. Overrides mentioned but not demonstrated - Line 489 references overrides conceptually, but developers would benefit from seeing a concrete code example. docs/adapters/elevenlabs.md lines 47-58 shows how to pass overrides: { voiceId, systemPrompt, firstMessage, language } at token generation time.

📝 Proposed documentation improvements

Option 1: Align endpoint path with elevenlabs.md

-  getToken: () => fetch('/api/elevenlabs-token').then(r => r.json()),
+  getToken: () => fetch('/api/realtime-token', { method: 'POST' }).then(r => r.json()),

Option 2: Document adapter options

Add after line 486:

const { status, messages, connect, disconnect } = useRealtimeChat({
  getToken: () => fetch('/api/realtime-token', { method: 'POST' }).then(r => r.json()),
  adapter: elevenlabsRealtime({
    connectionMode: 'websocket', // or 'webrtc'
    debug: true, // enable debug logging
  }),
})

Option 3: Show overrides example

Replace the note at line 489 with a concrete server-side example:

// Server: Override agent settings at token time
const token = await realtimeToken({
  adapter: elevenlabsRealtimeToken({
    agentId: process.env.ELEVENLABS_AGENT_ID!,
    overrides: {
      voiceId: 'custom-voice-id',
      systemPrompt: 'You are a helpful voice assistant.',
      firstMessage: 'Hello! How can I help you today?',
    },
  }),
})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/media/realtime-chat.md` around lines 475 - 490, Standardize the token
endpoint and expand the ElevenLabs docs: change the example in realtime-chat.md
to use the same endpoint path as docs/adapters/elevenlabs.md (use
/api/realtime-token), add a short snippet showing how to pass adapter options to
elevenlabsRealtime (mention connectionMode and debug) when calling
useRealtimeChat, and replace the vague "overrides" note with a concrete
server-side example that references realtimeToken and elevenlabsRealtimeToken
and shows passing overrides (voiceId, systemPrompt, firstMessage, language) at
token generation time; locate and update the examples around useRealtimeChat,
elevenlabsRealtime, realtimeToken, and elevenlabsRealtimeToken.

@AlemTuzlak AlemTuzlak merged commit 4afaa76 into main Apr 7, 2026
7 checks passed
@AlemTuzlak AlemTuzlak deleted the docs/expand-coverage branch April 7, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant