Skip to content

Installation

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.
<script src="https://cdn.responsivevoice.org/sdk/latest/responsivevoice.js"></script>
<script>
responsiveVoice.init({ apiKey: 'YOUR_API_KEY' });
responsiveVoice.speak('Hello, world!');
</script>

REST API client for direct server communication.

Terminal window
npm install @responsivevoice/api-client

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

Chrome 66+, Firefox 57+, Safari 12+, Edge 17+, iOS Safari 12+, Chrome Android 66+.

The browser bundle (CDN) includes all necessary polyfills and works in these browsers without any additional setup. ESM/CJS packages are syntax-compatible but leave browser polyfilling to your bundler.

PackageMinimumFull functionality
@responsivevoice/types14+All features
@responsivevoice/text14+All features
@responsivevoice/api-client16+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/core16+Browser-only (Web Speech API + audio playback); Node is the build environment (bundle with Vite/webpack), not a runtime target
@responsivevoice/features14+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.

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