npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-text-to-speech

v2.0.5

Published

Vue 3 text-to-speech plugin with composables, UI components, and multi-provider support

Readme

vue-text-to-speech

npm version npm downloads CI license

Vue 3 text-to-speech plugin with composables, drop-in components and multi-provider support — Web Speech API, OpenAI, ElevenLabs and Azure Cognitive Services, all behind one unified interface.

📖 Documentation · 🛝 Live Playground · 📦 NPM


Features

  • 🎙️ Four providers — Web Speech (zero config), OpenAI, ElevenLabs, Azure
  • Composable-firstuseSpeechSynthesis, useSpeechRecognition, useStreamingTTS, useVoiceQueue
  • 🤖 LLM streaming — pipe AsyncIterable<string> token streams directly to speech
  • 🧩 Drop-in componentsVueSpeechPlayer, VueSpeechRecorder, VueSpeechVoiceSelect
  • 🔒 Security-firstbaseURL override on all AI providers for server-side proxying
  • 📘 TypeScript — full declarations shipped, no @types/* needed
  • 🧪 207 tests — Vitest + @vue/test-utils, SSR-safe

Installation

npm install vue-text-to-speech
# pnpm add vue-text-to-speech
# yarn add vue-text-to-speech

Quick Start

// main.ts
import { createApp } from 'vue'
import { VueSpeech } from 'vue-text-to-speech'
import App from './App.vue'

createApp(App)
  .use(VueSpeech, { provider: 'web' })
  .mount('#app')
<script setup lang="ts">
import { useSpeechSynthesis } from 'vue-text-to-speech'

const { speak, stop, isSpeaking } = useSpeechSynthesis()
</script>

<template>
  <button @click="speak('Hello, world!')">Speak</button>
  <button @click="stop()">Stop</button>
</template>

AI Providers

// OpenAI
createApp(App).use(VueSpeech, {
  provider: 'openai',
  apiKey: import.meta.env.VITE_OPENAI_KEY,
  voice: 'nova',
  model: 'tts-1-hd',
}).mount('#app')

// ElevenLabs
createApp(App).use(VueSpeech, {
  provider: 'elevenlabs',
  apiKey: import.meta.env.VITE_ELEVEN_KEY,
  voiceId: 'EXAVITQu4vr4xnSDxMaL',   // default voice; find IDs at elevenlabs.io/voice-library
}).mount('#app')

// Azure Cognitive Services
createApp(App).use(VueSpeech, {
  provider: 'azure',
  subscriptionKey: import.meta.env.VITE_AZURE_KEY,
  region: 'eastus',
  voice: 'en-US-JennyNeural',
}).mount('#app')

⚠️ Never expose API keys in the browser. Use the baseURL option to proxy requests through your server. See the Security Guide.

LLM Streaming

import { useStreamingTTS } from 'vue-text-to-speech'

const { pipeStream, isStreaming, stop } = useStreamingTTS()

// Pipe any AsyncIterable<string> — tokens are split into sentences
// and spoken as they form using Intl.Segmenter
await pipeStream(myOpenAIStream())

Speech Recognition (STT)

import { useSpeechRecognition } from 'vue-text-to-speech'

const { start, stop, isListening, transcript, finalTranscript } =
  useSpeechRecognition({ lang: 'en-US', continuous: true })

Always uses the browser's SpeechRecognition API regardless of the TTS provider configured.

Drop-in Components

<!-- Full player: voice select + sliders + controls -->
<VueSpeechPlayer text="Hello from vue-text-to-speech!" />

<!-- Mic button with live transcript -->
<VueSpeechRecorder @final-transcript="onTranscript" />

<!-- Standalone voice selector (pair with useSpeechSynthesis) -->
<VueSpeechVoiceSelect v-model="selectedVoice" :voices="voices" :loading="isLoadingVoices" />

Register all three components globally in one go:

createApp(App)
  .use(VueSpeech, { provider: 'web', components: true })
  .mount('#app')

Documentation

Full API reference, provider guides and integration examples:
👉 vue-text-to-speech-docs.vercel.app

Live Playground

Try all providers and components in the browser:
👉 vue-text-to-speech-playground.vercel.app

Changelog

See CHANGELOG.md for release history and migration notes from v1.

License

MIT © kunchamvasu