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

# Installation

## Core package

The main client library for browser text-to-speech. Both paths deliver the same package — pick the one that fits your project:

- **Browser bundle (CDN)** — no build step; add one script tag and use the global `responsiveVoice`. Best for plain HTML, prototypes, CMS sites, and legacy pages. Call `init()` with your API key — without it you get demo mode (browser default voice only).
- **npm** — for apps with a bundler (Vite, webpack, Next). Install and import.

**Browser bundle (CDN)**

```html
<script src="https://cdn.responsivevoice.org/sdk/latest/responsivevoice.js"></script>
<script>
  responsiveVoice.init({ apiKey: 'YOUR_API_KEY' });
  responsiveVoice.speak('Hello, world!');
</script>
```

**npm**

```bash
npm install @responsivevoice/core
# or: pnpm add @responsivevoice/core
# or: yarn add @responsivevoice/core
```

```typescript
import { getResponsiveVoice } from '@responsivevoice/core';

const rv = await getResponsiveVoice({ apiKey: 'YOUR_API_KEY' });
```

## API client

REST API client for direct server communication.

**npm**

```bash
npm install @responsivevoice/api-client
```

**pnpm**

```bash
pnpm add @responsivevoice/api-client
```

**yarn**

```bash
yarn add @responsivevoice/api-client
```

## Types package

`@responsivevoice/types` (TypeScript types + Zod schemas) ships automatically as a dependency of the packages above, and `api-client` re-exports the common ones — so you rarely install it directly. If you want the schemas standalone: `npm install @responsivevoice/types`.

## Requirements

### Browsers

The browser bundle (CDN) is Babel + core-js polyfilled and works in Chrome 69+, Firefox 65+, Safari 12+, Edge 79+, iOS Safari 12+, Chrome Android 69+, Android WebView 69+ without any additional setup. ESM/CJS packages are syntax-compatible but leave browser polyfilling to your bundler; see [Browser Support](/guides/browser-support/) for each package's minimum browser versions.

### Node.js

| Package                       | Minimum | Full functionality                                                                                                                                                          |
| ----------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@responsivevoice/types`      | 14+     | All features                                                                                                                                                                |
| `@responsivevoice/text`       | 14+     | All features                                                                                                                                                                |
| `@responsivevoice/api-client` | 16+     | HTTP synthesis requires Node 18+ for native `fetch` and `Blob`. On Node 16–17, pass a `fetch` implementation via the `fetch` config option (e.g. `node-fetch` or `undici`). |
| `@responsivevoice/core`       | 16+     | Browser-only (Web Speech API + audio playback); Node is the build environment (bundle with Vite/webpack), not a runtime target                                              |
| `@responsivevoice/features`   | 14+     | Browser-only (DOM APIs)                                                                                                                                                     |

WebSocket streaming requires Node 22+ for the native `WebSocket` global, or pass any W3C-compatible WebSocket implementation (e.g. the `ws` package) via the `WebSocket` config option.

### TypeScript

5.0+ (optional, but recommended). Full type definitions included in all packages.
