> ## Documentation Index
> Fetch the complete documentation index at: https://docs.responsivevoice.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

Explore working examples that demonstrate ResponsiveVoice capabilities. All examples live in the [examples repository](https://github.com/responsivevoice/examples).

## CDN Examples

Drop a `<script>` tag on any page — no build step.

- [Basic Example](/examples/basic) — Minimal TTS with speak, cancel, and events
- [Extended Usage Example](/examples/extended) — Voice selection, speech controls, and event logging
- [Web Player](/examples/web-player) — Inline pill player with paragraph highlighting, multi-mount, and imperative rv.webPlayer.mount()
- [Web Player Customization](/examples/web-player-customization) — Live control panel for every webPlayer option — theme, controls, navigation, layout, spacing
- [Voice Selector](/examples/voice-selector) — Side-by-side teacher for the three selector forms — by name, by RegExp pattern, by VoiceQuery
- [Events & Callbacks](/examples/events-callbacks) — Side-by-side view of global events vs per-call callbacks during speech

## npm Examples

Install `@responsivevoice/core` from npm and bundle with your tool of choice.

- [npm + Vite Example](/examples/vite) — ESM import bundled by Vite

## Node.js Examples

Server-side usage — runs in Node.js, not the browser. Uses `@responsivevoice/api-client`.

- [CLI Tool](/examples/cli) — Command-line text-to-speech utility
- [HTTP Server](/examples/server) — REST API server for TTS synthesis

## Running Locally

```bash
git clone https://github.com/responsivevoice/examples.git
cd examples
npm install
```

### Browser — CDN examples

```bash
npm run serve
# open http://localhost:3000/browser/basic/ or /browser/extended/
```

### Browser — Vite example

```bash
npm run vite:dev
# open http://localhost:5173/
```

### Node.js

```bash
export RESPONSIVEVOICE_API_KEY="your-api-key"        # https://app.responsivevoice.org
export RESPONSIVEVOICE_API_SECRET="your-api-secret"  # "Server-to-server API secrets"
npm run cli -- "Hello, world!"
npm run server
```

## Live Demo

Try ResponsiveVoice directly in the [app](https://app.responsivevoice.org).
