Basic Example
The simplest ResponsiveVoice integration — drop in a script tag and speak text. Works without an API key using browser-native voices (demo mode).
Minimal integration
Section titled “Minimal integration”<script src="https://cdn.responsivevoice.org/sdk/latest/responsivevoice.js"></script><script> const rv = window.responsiveVoice;
rv.addEventListener('OnReady', () => { rv.speak('Hello! Welcome to ResponsiveVoice.'); });
rv.init({ // Get a free API key at https://responsivevoice.org/register // apiKey: 'YOUR_RESPONSIVEVOICE_API_KEY', });</script>Without an API key the library runs in demo mode — it falls back to browser-native Web Speech API voices. Call rv.isDemoMode() at runtime to detect this state (for example, to surface a "Demo Mode" indicator in your UI).
Next Steps
Section titled “Next Steps”- Extended Usage Example — voice selection, speech controls, event logging
- npm + Vite Example — the same flow via ESM import and a bundler
- Events Guide — the full event lifecycle
- Voice Selection Guide — picking voices programmatically