🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

web-voice-assistant

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-voice-assistant

A lightweight voice assistant for web applications with AI response capabilities using the Web Speech API.

1.0.6
latest
Source
npm
Version published
Weekly downloads
36
-60%
Maintainers
1
Weekly downloads
 
Created
Source

WebVoiceAssistant 🎙️

npm version License: MIT Bundle Size Downloads

A lightweight voice assistant for web applications with AI response capabilities using the Web Speech API.

Features ✨

  • 🗣️ Speech recognition (voice-to-text)
  • 🔊 Text-to-speech synthesis
  • 🤖 Gemini AI integration
  • 🌐 Cross-browser support
  • ⚡ No dependencies
  • 🎨 Fully customizable UI
  • 🔌 Multiple integration options

Installation 📦

npm install web-voice-assistant
# or 
yarn add web-voice-assistant
# or
pnpm add web-voice-assistant

For browser/CDN usage:

<script src="https://cdn.jsdelivr.net/npm/web-voice-assistant@latest/dist/web-voice-assistant.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/web-voice-assistant"></script>

Basic Usage

const assistant = new WebVoiceAssistant({
  geminiApiKey: "your-api-key-here", // Required
  language: 'en-US',                // Optional
  position: "bottom-right",         // Optional
  buttonSize: 70,                   // Optional
  panelWidth: 400                   // Optional
});

Complete Configuration Options

OptionTypeDefaultDescription
geminiApiKeystring-Gemini API key (Required)
modelstringgemini-1.5-flashGemini model version
languagestringen-USSpeech recognition language
positionstringbottom-rightButton position
buttonSizenumber60Button size in pixels
panelWidthnumber350Panel width in pixels
panelHeightnumber450Panel height in pixels
ratenumber0.9Speech speed (0.1-2.0)
pitchnumber1Voice pitch (0-2.0)
contextSizenumber5000Context size in words
ButtonBackGroundColourstringblackButton background color
svgColorstringwhiteIcon color
textColorstringwhiteText color
PanelBackgroundColorstringrgb(24 24 27)Panel background
MessagesBackgroundColorstringrgb(24 24 27)Messages background

Framework Examples

React Component

import { useEffect } from 'react';
import WebVoiceAssistant from 'web-voice-assistant';

function VoiceAssistant() {
  useEffect(() => {
    const assistant = new WebVoiceAssistant({
      geminiApiKey: process.env.REACT_APP_GEMINI_KEY,
      position: 'bottom-left',
      buttonSize: 70
    });
    return () => assistant.destroy();
  }, []);

  return null;
}

Next.js Component

'use client';
import { useEffect } from 'react';
import WebVoiceAssistant from 'web-voice-assistant';

export default function VoiceAssistant() {
  useEffect(() => {
    const assistant = new WebVoiceAssistant({
      geminiApiKey: process.env.NEXT_PUBLIC_GEMINI_KEY,
      panelWidth: 400
    });
    return () => assistant.destroy();
  }, []);
  
  return null;
}

Browser Support

BrowserSupport
Chrome✅ Full
Firefox✅ Full
Edge✅ Full
Safari⚠️ Partial
Mobile Chrome✅ Full
Mobile Safari⚠️ Partial

Troubleshooting

  • Microphone not working: Check browser permissions
  • API errors: Verify your Gemini API key
  • UI not appearing: Ensure no CSS conflicts
  • SSR issues: Use dynamic imports in Next.js

License

MIT © Abdullah Mukadam

Keywords

voice-assistant

FAQs

Package last updated on 13 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts