{"_id":"@albertasoft/promptica-speech-to-text","_rev":"17-4c887e3c017e043927831e72b404d2d8","name":"@albertasoft/promptica-speech-to-text","dist-tags":{"latest":"1.0.42"},"versions":{"1.0.1":{"name":"@albertasoft/promptica-speech-to-text","version":"1.0.1","keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"author":{"name":"Promptica"},"license":"MIT","_id":"@albertasoft/promptica-speech-to-text@1.0.1","maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"dist":{"shasum":"d40eaf80755b8cf01e606ea38c9cd7857009592c","tarball":"https://registry.npmjs.org/@albertasoft/promptica-speech-to-text/-/promptica-speech-to-text-1.0.1.tgz","fileCount":12,"integrity":"sha512-9ul/Rl0BCtaP5AQ85UTTTwhGwozFVAd6BWveMTZnq1jiT0s0Rj3b21Ac0fjRlyWfGJgKgjoM+CWgf/o7YgCgNQ==","signatures":[{"sig":"MEQCIEFkKRC9vwTOTjDDAPGHMK2Vaa/XStOFObE8oq9F+4PFAiBx2F1s43hdMyJjc4bc1x9yxgwLzxRXxpF4T3z7Tl6pAQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":215562},"main":"./dist/promptica-speech-to-text.umd.js","types":"./dist/index.d.ts","module":"./dist/promptica-speech-to-text.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/promptica-speech-to-text.es.js","require":"./dist/promptica-speech-to-text.umd.js"}},"gitHead":"fe8087486bf575707f871432968a1452754a9d7b","scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"vite build --config vite.config.lib.obfuscated.ts","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"},"_npmVersion":"11.6.0","description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","directories":{},"_nodeVersion":"24.8.0","dependencies":{"react":"^19.1.1","react-dom":"^19.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.7","eslint":"^9.36.0","terser":"^5.44.0","globals":"^16.4.0","@eslint/js":"^9.36.0","typescript":"~5.9.3","@types/node":"^24.6.0","tailwindcss":"^4.1.14","@types/react":"^19.1.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.1.9","@tailwindcss/vite":"^4.1.14","typescript-eslint":"^8.45.0","@vitejs/plugin-react":"^5.0.4","javascript-obfuscator":"^4.1.1","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.22"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promptica-speech-to-text_1.0.1_1761704234545_0.11300506551388412","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@albertasoft/promptica-speech-to-text","version":"1.0.2","keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"author":{"name":"Promptica"},"license":"MIT","_id":"@albertasoft/promptica-speech-to-text@1.0.2","maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"dist":{"shasum":"689683d6d327c7a5b2b94007311e33d04dba9589","tarball":"https://registry.npmjs.org/@albertasoft/promptica-speech-to-text/-/promptica-speech-to-text-1.0.2.tgz","fileCount":12,"integrity":"sha512-dHTlN9LE2SNQL5MhALTYoedBgAjJ1xHMazy8H6e930A5lyNnSyUvfh1M9KqZlQ8NyugdbwJ0MY1GzB/yUQYi9g==","signatures":[{"sig":"MEUCIQDqUjQQ6k3eogrSDFEY8OoLreqdrk7Qof+bm6ecp7V1QAIgA0LcDfHwox/oF+WnMPLHSK5s2CdmTfImMKHRosM7J1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":223407},"main":"./dist/promptica-speech-to-text.umd.js","types":"./dist/index.d.ts","module":"./dist/promptica-speech-to-text.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/promptica-speech-to-text.es.js","require":"./dist/promptica-speech-to-text.umd.js"}},"gitHead":"56344a934b42856b3ae764d3284885c5032112f0","scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"vite build --config vite.config.lib.obfuscated.ts","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"},"_npmVersion":"11.6.0","description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","directories":{},"_nodeVersion":"24.8.0","dependencies":{"react":"^19.1.1","react-dom":"^19.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.7","eslint":"^9.36.0","terser":"^5.44.0","globals":"^16.4.0","@eslint/js":"^9.36.0","typescript":"~5.9.3","@types/node":"^24.6.0","tailwindcss":"^4.1.14","@types/react":"^19.1.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.1.9","@tailwindcss/vite":"^4.1.14","typescript-eslint":"^8.45.0","@vitejs/plugin-react":"^5.0.4","javascript-obfuscator":"^4.1.1","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.22"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promptica-speech-to-text_1.0.2_1761717242861_0.3040117262956259","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@albertasoft/promptica-speech-to-text","version":"1.0.3","keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"author":{"name":"Promptica"},"license":"MIT","_id":"@albertasoft/promptica-speech-to-text@1.0.3","maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"dist":{"shasum":"4a91bacaf7a841479bb49b6a6a780959e074aefc","tarball":"https://registry.npmjs.org/@albertasoft/promptica-speech-to-text/-/promptica-speech-to-text-1.0.3.tgz","fileCount":12,"integrity":"sha512-XlrQqWSxev+6jGoRVAIdu/05gFtkOPakD7V48Hx2bk5mhPXt4BpEVjXx21jrDmHKYpf/rtdWQA/WZPtfT8CqDQ==","signatures":[{"sig":"MEUCICLk3NhBHn8A7+hUuFlqNAyqGDC9T+rlb9VCwWc5ZO9PAiEAmdIxN7hhLJJu6BVH2v3bhvgGc0WH//okI3DxNhaYpWE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":212458},"main":"./dist/promptica-speech-to-text.umd.js","types":"./dist/index.d.ts","module":"./dist/promptica-speech-to-text.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/promptica-speech-to-text.es.js","require":"./dist/promptica-speech-to-text.umd.js"}},"gitHead":"1551c16bbe0b590d7351c4718c6e7b2be5a77cfe","scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"vite build --config vite.config.lib.obfuscated.ts","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"},"_npmVersion":"11.6.0","description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","directories":{},"_nodeVersion":"24.8.0","dependencies":{"react":"^19.1.1","react-dom":"^19.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.7","eslint":"^9.36.0","terser":"^5.44.0","globals":"^16.4.0","@eslint/js":"^9.36.0","typescript":"~5.9.3","@types/node":"^24.6.0","tailwindcss":"^4.1.14","@types/react":"^19.1.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.1.9","@tailwindcss/vite":"^4.1.14","typescript-eslint":"^8.45.0","@vitejs/plugin-react":"^5.0.4","javascript-obfuscator":"^4.1.1","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.22"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promptica-speech-to-text_1.0.3_1761754227217_0.9260418139581281","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@albertasoft/promptica-speech-to-text","version":"1.0.4","keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"author":{"name":"Promptica"},"license":"MIT","_id":"@albertasoft/promptica-speech-to-text@1.0.4","maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"dist":{"shasum":"ee72222a000a5fa53bb10145add6b4dcb6da4b7b","tarball":"https://registry.npmjs.org/@albertasoft/promptica-speech-to-text/-/promptica-speech-to-text-1.0.4.tgz","fileCount":12,"integrity":"sha512-QV0FNqgDeYb8aqo4/PESJdwGqSFOEpP4jo0UupWB3/+UbxH2y/YIzYd4Z960ls3juAsZmDTl6lNzxhpTU629Rg==","signatures":[{"sig":"MEQCIFjmE7VEBPxne8wFF7gpmCE13Kqaw//pYjwWqR3FnCpLAiAa5ud6qfxCNAhw+QW6K8MTqiDZWanIuPTFHQC2F/awaQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":212480},"main":"./dist/promptica-speech-to-text.umd.js","types":"./dist/index.d.ts","module":"./dist/promptica-speech-to-text.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/promptica-speech-to-text.es.js","require":"./dist/promptica-speech-to-text.umd.js"}},"gitHead":"c49ece3892e8fe1dee414c87697c334ee85f3954","scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"vite build --config vite.config.lib.obfuscated.ts","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"},"_npmVersion":"11.6.0","description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","directories":{},"_nodeVersion":"24.8.0","dependencies":{"react":"^19.1.1","react-dom":"^19.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.7","eslint":"^9.36.0","terser":"^5.44.0","globals":"^16.4.0","@eslint/js":"^9.36.0","typescript":"~5.9.3","@types/node":"^24.6.0","tailwindcss":"^4.1.14","@types/react":"^19.1.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.1.9","@tailwindcss/vite":"^4.1.14","typescript-eslint":"^8.45.0","@vitejs/plugin-react":"^5.0.4","javascript-obfuscator":"^4.1.1","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.22"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promptica-speech-to-text_1.0.4_1761928020508_0.11061406256457995","host":"s3://npm-registry-packages-npm-production"}},"1.0.41":{"name":"@albertasoft/promptica-speech-to-text","version":"1.0.41","keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"author":{"name":"Promptica"},"license":"MIT","_id":"@albertasoft/promptica-speech-to-text@1.0.41","maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"dist":{"shasum":"70923ff52d0ad79fe82cda0a0a2073e5df06704f","tarball":"https://registry.npmjs.org/@albertasoft/promptica-speech-to-text/-/promptica-speech-to-text-1.0.41.tgz","fileCount":12,"integrity":"sha512-DzjqeJhNUaV16fBEoeBHqr9DnOXVSvu59AOq8z4xqoDzX6KZrKuKXvZG1wCR5n5HGmwzOqt2/Q/NbrPeYeJ5ag==","signatures":[{"sig":"MEUCIBephwuZVrdkn+h9ZukyxkN/Yw1KxhDEg4jlDBTyL1PoAiEAlLyTUhkEeKiWWCBhkwGPeOvpbFXO2vFTGbWf6vYcJWI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":222142},"main":"./dist/promptica-speech-to-text.umd.js","types":"./dist/index.d.ts","module":"./dist/promptica-speech-to-text.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/promptica-speech-to-text.es.js","require":"./dist/promptica-speech-to-text.umd.js"}},"gitHead":"e514465c37bd0bd9813e1337063ae1e3ebac1b2c","scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"vite build --config vite.config.lib.obfuscated.ts","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"},"_npmVersion":"11.6.0","description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","directories":{},"_nodeVersion":"24.8.0","dependencies":{"react":"^19.1.1","react-dom":"^19.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.7","eslint":"^9.36.0","terser":"^5.44.0","globals":"^16.4.0","@eslint/js":"^9.36.0","typescript":"~5.9.3","@types/node":"^24.6.0","tailwindcss":"^4.1.14","@types/react":"^19.1.16","vite-plugin-dts":"^4.5.4","@types/react-dom":"^19.1.9","@tailwindcss/vite":"^4.1.14","typescript-eslint":"^8.45.0","@vitejs/plugin-react":"^5.0.4","javascript-obfuscator":"^4.1.1","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.22"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promptica-speech-to-text_1.0.41_1762457243771_0.9687580321960869","host":"s3://npm-registry-packages-npm-production"}},"1.0.42":{"name":"@albertasoft/promptica-speech-to-text","version":"1.0.42","description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","main":"./dist/promptica-speech-to-text.umd.js","module":"./dist/promptica-speech-to-text.es.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/promptica-speech-to-text.es.js","require":"./dist/promptica-speech-to-text.umd.js"}},"scripts":{"dev":"vite","build":"tsc -b && vite build","build:lib":"vite build --config vite.config.lib.obfuscated.ts","prepublishOnly":"npm run build:lib","lint":"eslint .","preview":"vite preview"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"dependencies":{"react":"^19.2.3","react-dom":"^19.2.3"},"devDependencies":{"@eslint/js":"^9.36.0","@tailwindcss/vite":"^4.1.14","@types/node":"^24.6.0","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^5.0.4","eslint":"^9.36.0","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.22","globals":"^16.4.0","javascript-obfuscator":"^4.1.1","tailwindcss":"^4.1.14","terser":"^5.44.0","typescript":"~5.9.3","typescript-eslint":"^8.45.0","vite":"^7.1.7","vite-plugin-dts":"^4.5.4"},"keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"author":{"name":"Promptica"},"license":"MIT","_id":"@albertasoft/promptica-speech-to-text@1.0.42","gitHead":"c8918decb1bcb24fd45cc8d209038e39bd46b451","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-pdRgj6ERrF6YpvtgThK6GKg5hYRzK2La9rt0XhymTW1+/YtkoFdPUooesS9PtcxmeBcBgnhzPDtsjSF6TpO90w==","shasum":"0e2fff692e8603c0136ae845e62f64b59ceb4d9a","tarball":"https://registry.npmjs.org/@albertasoft/promptica-speech-to-text/-/promptica-speech-to-text-1.0.42.tgz","fileCount":12,"unpackedSize":224208,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC41X+go1hb1tESQb4/YxBFtjkwKD+2vf5H1Kk3xjW6vQIgX8l1I96KcwDL7QSOTq97cHBQGkayN7xZ9fj81nRCz+I="}]},"_npmUser":{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"},"directories":{},"maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promptica-speech-to-text_1.0.42_1765495163118_0.7118372270167499"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-29T02:17:14.477Z","modified":"2025-12-11T23:19:23.521Z","1.0.0":"2025-10-26T23:36:11.536Z","1.2.0":"2025-10-27T04:00:14.439Z","1.2.1":"2025-10-27T05:45:08.327Z","1.2.11":"2025-10-27T05:49:22.023Z","1.2.12":"2025-10-27T16:54:30.145Z","1.2.13":"2025-10-27T17:57:23.599Z","1.2.14":"2025-10-29T01:50:11.190Z","1.2.15":"2025-10-29T01:56:59.677Z","1.2.16":"2025-10-29T01:58:46.036Z","1.0.1":"2025-10-29T02:17:14.752Z","1.0.2":"2025-10-29T05:54:03.066Z","1.0.3":"2025-10-29T16:10:27.407Z","1.0.4":"2025-10-31T16:27:00.736Z","1.0.41":"2025-11-06T19:27:23.971Z","1.0.42":"2025-12-11T23:19:23.285Z"},"author":{"name":"Promptica"},"license":"MIT","keywords":["react","speech-recognition","speech-to-text","voice","web-speech-api","typescript","react-hook","speech","voice-recognition","audio"],"description":"A comprehensive React library for speech recognition with authentication, encryption, and usage tracking","maintainers":[{"name":"mahdimzh","email":"ma.mohammadizadeh@gmail.com"}],"readme":"# 🎤 Promptica Speech-to-Text\n\nA powerful, flexible, and easy-to-use React speech-to-text library from promptica.ca Features include real-time transcription, multiple language support, and both hook and component-based APIs.\n\n**🎯 Zero Configuration Required** - Import and use anywhere in your React app. No HTML elements needed. Full flexibility! \njust signe up in promptica.ca and get a access token.\n\n## ✨ Features\n\n- 🎯 **Simple Hook API** - Easy integration with `useSpeechToText()`\n- 🎨 **Pre-built UI Component** - Ready-to-use interface with controls\n<!-- - 🌍 **Multi-language Support** - 20+ languages built-in -->\n- ⚡ **Real-time Transcription** - Live interim and final results\n- 🌐 **Global API** - Access from anywhere via `window.promptica.speechToText`\n- 📱 **TypeScript Support** - Full type safety and IntelliSense\n- 🔧 **Highly Configurable** - Customize behavior and callbacks\n- 🎭 **Browser Compatible** - Works with Chrome, Edge, Safari\n- 🔐 **Secure Authentication** - Token-based API authentication with encryption\n- 📊 **Usage Analytics** - Automatic tracking with browser metadata collection\n- 🔒 **Code Protection** - Built with advanced obfuscation for security\n\n## 📦 Installation\n\n```bash\nnpm install promptica-speech-to-text\n# or\npnpm install promptica-speech-to-text\n# or\nyarn add promptica-speech-to-text\n```\n\n> **Note:** This is a library - **no HTML elements are automatically created**. You have full control over where and how to mount components. No `<div id=\"...\">` required!\n\n## 🚀 Quick Start\n\n### Option 1: Using the Hook (Custom UI)\n\nPerfect for when you want full control over the UI:\n\n```tsx\nimport { useSpeechToText } from 'promptica-speech-to-text';\n\nfunction MyComponent() {\n  const speechToText = useSpeechToText(\n    { token: 'your-promptica-token' }, // Authentication\n    {\n      language: 'en-US',\n      continuous: true,\n      interimResults: true,\n    }\n  );\n\n  return (\n    <div>\n      <button onClick={speechToText.start} disabled={!speechToText.ready}>\n        Start Listening\n      </button>\n      <button onClick={speechToText.stop}>Stop</button>\n      <p>Interim: {speechToText.interimTranscript}</p>\n      <p>Final: {speechToText.finalTranscript}</p>\n      {speechToText.error && <p>Error: {speechToText.error}</p>}\n    </div>\n  );\n}\n```\n\n### Option 2: Using the Pre-built UI Component\n\nUse our styled component - just pass configuration:\n\n```tsx\nimport { useSpeechToText, SpeechToTextUI } from 'promptica-speech-to-text';\n\nfunction App() {\n  const speech = useSpeechToText({\n    language: 'en-US',\n    continuous: true,\n    interimResults: true,\n  });\n\n  const handleTranscriptChange = (transcript: string) => {\n    console.log('Current transcript:', transcript);\n  };\n\n  const handleFinalTranscript = (finalText: string) => {\n    console.log('Final transcript:', finalText);\n  };\n\n  return (\n    <SpeechToTextUI\n      instance={speech}\n      showUI={true} // Set to false for headless mode\n      onTranscriptChange={handleTranscriptChange}\n      onFinalTranscript={handleFinalTranscript}\n      placeholder=\"Click the microphone to start speaking...\"\n    />\n  );\n}\n```\n\n### Option 3: Headless Mode (No UI at all!)\n\nPerfect for voice commands, accessibility features, or when you want console-only control:\n\n```tsx\nimport { useSpeechToText, globalSpeechAPI } from 'promptica-speech-to-text';\nimport { useEffect } from 'react';\n\nfunction App() {\n  const speech = useSpeechToText({\n    language: 'en-US',\n    continuous: true,\n  });\n  \n  // Initialize global API for console control\n  useEffect(() => {\n    globalSpeechAPI.init(speech);\n  }, [speech]);\n\n  // Use speech.transcript programmatically\n  useEffect(() => {\n    if (speech.transcript.includes('hello')) {\n      console.log('User said hello!');\n    }\n  }, [speech.transcript]);\n\n  // No UI rendered - all control via code or console!\n  return null;\n}\n```\n\nThen control from **anywhere** (even browser console):\n\n```javascript\n// See all available commands\nwindow.promptica.speechToText.help();\n\n// Check current status\nwindow.promptica.speechToText.getInstanceStatus();\n\n// Start listening\nwindow.promptica.speechToText.start();\n\n// Stop listening\nwindow.promptica.speechToText.stop();\n\n// Change language\nwindow.promptica.speechToText.setLanguage('es-ES');\n\n// Get transcript\nconst text = window.promptica.speechToText.getTranscript();\n\n// Get available languages\nconst languages = window.promptica.speechToText.getAvailableLanguages();\n\n// Check browser support\nwindow.promptica.speechToText.checkBrowserSupport();\n```\n\n## 📖 API Reference\n\n### `useSpeechToText(config?, callbacks?)`\n\nThe main hook for speech recognition.\n\n#### Parameters\n\n**config** (optional): `SpeechToTextConfig`\n```typescript\n{\n  continuous?: boolean;        // Keep listening (default: true)\n  interimResults?: boolean;    // Show interim results (default: true)\n  language?: string;           // Language code (default: 'en-US')\n  maxAlternatives?: number;    // Max alternatives (default: 1)\n  grammars?: SpeechGrammarList; // Speech grammars\n}\n```\n\n**callbacks** (optional): `SpeechToTextCallbacks`\n```typescript\n{\n  onStart?: () => void;\n  onEnd?: () => void;\n  onResult?: (result: SpeechToTextResult) => void;\n  onError?: (error: SpeechRecognitionErrorEvent) => void;\n  onNoMatch?: () => void;\n  onSoundStart?: () => void;\n  onSoundEnd?: () => void;\n  onSpeechStart?: () => void;\n  onSpeechEnd?: () => void;\n  onAudioStart?: () => void;\n  onAudioEnd?: () => void;\n}\n```\n\n#### Returns: `SpeechToTextInstance`\n\n```typescript\n{\n  start: () => void;                    // Start listening\n  stop: () => void;                     // Stop listening\n  abort: () => void;                    // Abort recognition\n  isListening: boolean;                 // Current listening state\n  isSupported: boolean;                 // Browser support check\n  transcript: string;                   // Full transcript\n  interimTranscript: string;            // Current interim text\n  finalTranscript: string;              // All final text\n  error: string | null;                 // Last error message\n  setConfig: (config) => void;          // Update configuration\n  setCallbacks: (callbacks) => void;    // Update callbacks\n  clearTranscript: () => void;          // Clear all text\n  getLanguages: () => string[];         // Get available languages\n}\n```\n\n## 🎯 Usage Examples\n\n> **Important:** No HTML elements are required! Just import and use. The library gives you full control.\n\n### Example 1: Basic Transcription\n\n```tsx\nimport { useSpeechToText } from 'promptica-speech-to-text';\n\nfunction BasicTranscription() {\n  const { start, stop, transcript, isListening } = useSpeechToText();\n\n  return (\n    <div>\n      <button onClick={isListening ? stop : start}>\n        {isListening ? 'Stop' : 'Start'}\n      </button>\n      <p>{transcript}</p>\n    </div>\n  );\n}\n```\n\n### Example 2: With Custom Callbacks\n\n```tsx\nimport { useSpeechToText } from 'promptica-speech-to-text';\n\nfunction CustomCallbacks() {\n  const [results, setResults] = useState([]);\n\n  const speechToText = useSpeechToText(\n    { language: 'en-US', continuous: true },\n    {\n      onResult: (result) => {\n        if (result.isFinal) {\n          setResults(prev => [...prev, result.transcript]);\n          console.log(`Confidence: ${result.confidence}`);\n        }\n      },\n      onError: (error) => {\n        console.error('Speech recognition error:', error);\n      },\n      onStart: () => console.log('Started listening'),\n      onEnd: () => console.log('Stopped listening'),\n    }\n  );\n\n  return (\n    <div>\n      <button onClick={speechToText.start}>Start</button>\n      <button onClick={speechToText.stop}>Stop</button>\n      <ul>\n        {results.map((text, i) => (\n          <li key={i}>{text}</li>\n        ))}\n      </ul>\n    </div>\n  );\n}\n```\n\n### Example 3: Multi-language Support\n\n```tsx\nimport { useSpeechToText } from 'promptica-speech-to-text';\n\nfunction MultiLanguage() {\n  const speechToText = useSpeechToText();\n  const [language, setLanguage] = useState('en-US');\n\n  const handleLanguageChange = (lang: string) => {\n    setLanguage(lang);\n    speechToText.setConfig({ language: lang });\n  };\n\n  return (\n    <div>\n      <select value={language} onChange={(e) => handleLanguageChange(e.target.value)}>\n        {speechToText.getLanguages().map(lang => (\n          <option key={lang} value={lang}>{lang}</option>\n        ))}\n      </select>\n      <button onClick={speechToText.start}>Start</button>\n      <button onClick={speechToText.stop}>Stop</button>\n      <p>{speechToText.transcript}</p>\n    </div>\n  );\n}\n```\n\n### Example 4: Imperative Handle with Ref\n\n```tsx\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport { useSpeechToText, type SpeechToTextInstance } from 'promptica-speech-to-text';\n\nexport interface SpeechToTextRef extends SpeechToTextInstance {}\n\nconst SpeechToTextImperative = forwardRef<SpeechToTextRef>((_, ref) => {\n  const speechToText = useSpeechToText();\n  \n  useImperativeHandle(ref, () => speechToText, [speechToText]);\n\n  return (\n    <div>\n      <div>Status: {speechToText.isListening ? 'Listening' : 'Stopped'}</div>\n      <div>Transcript: {speechToText.transcript}</div>\n    </div>\n  );\n});\n\n// Usage\nfunction App() {\n  const speechRef = useRef<SpeechToTextRef>(null);\n\n  return (\n    <div>\n      <button onClick={() => speechRef.current?.start()}>Start</button>\n      <button onClick={() => speechRef.current?.stop()}>Stop</button>\n      <SpeechToTextImperative ref={speechRef} />\n    </div>\n  );\n}\n```\n\n### Example 5: With Form Integration\n\n```tsx\nimport { useSpeechToText } from 'promptica-speech-to-text';\n\nfunction FormIntegration() {\n  const [formData, setFormData] = useState({ message: '' });\n  const speechToText = useSpeechToText({\n    continuous: false,\n    interimResults: false,\n  });\n\n  useEffect(() => {\n    if (speechToText.finalTranscript) {\n      setFormData(prev => ({\n        ...prev,\n        message: prev.message + ' ' + speechToText.finalTranscript,\n      }));\n      speechToText.clearTranscript();\n    }\n  }, [speechToText.finalTranscript]);\n\n  return (\n    <form>\n      <textarea\n        value={formData.message}\n        onChange={(e) => setFormData({ message: e.target.value })}\n        placeholder=\"Type or speak your message...\"\n      />\n      <button type=\"button\" onClick={speechToText.start}>\n        🎤 Voice Input\n      </button>\n      <button type=\"submit\">Send</button>\n    </form>\n  );\n}\n```\n\n## 🌍 Supported Languages\n\n- `en-US` - English (United States)\n- `en-GB` - English (United Kingdom)\n- `es-ES` - Spanish (Spain)\n- `fr-FR` - French (France)\n- `de-DE` - German (Germany)\n- `it-IT` - Italian (Italy)\n- `ja-JP` - Japanese (Japan)\n- `ko-KR` - Korean (South Korea)\n- `pt-BR` - Portuguese (Brazil)\n- `ru-RU` - Russian (Russia)\n- `zh-CN` - Chinese (Simplified)\n- `zh-TW` - Chinese (Traditional)\n- `ar-SA` - Arabic (Saudi Arabia)\n- `hi-IN` - Hindi (India)\n- `nl-NL` - Dutch (Netherlands)\n- `pl-PL` - Polish (Poland)\n- `tr-TR` - Turkish (Turkey)\n- `sv-SE` - Swedish (Sweden)\n- `da-DK` - Danish (Denmark)\n- `fi-FI` - Finnish (Finland)\n\n## 🔧 Configuration Options\n\n### SpeechToTextUI Props\n\n```typescript\ninterface SpeechToTextUIProps {\n  onTranscriptChange?: (transcript: string) => void;\n  onFinalTranscript?: (transcript: string) => void;\n  showInterim?: boolean;           // Show interim results (default: true)\n  className?: string;               // Custom container class\n  buttonClassName?: string;         // Custom button class\n  textareaClassName?: string;       // Custom textarea class\n  language?: string;                // Initial language (default: 'en-US')\n  continuous?: boolean;             // Continuous listening (default: true)\n  placeholder?: string;             // Textarea placeholder\n}\n```\n\n## ⚠️ Browser Support\n\nThe Web Speech API is supported in:\n- ✅ Chrome 25+\n- ✅ Edge 79+\n- ✅ Safari 14.1+\n- ❌ Firefox (not supported)\n\nCheck browser support:\n```typescript\nconst { isSupported } = useSpeechToText();\n\nif (!isSupported) {\n  return <div>Speech recognition is not supported in this browser.</div>;\n}\n```\n\n## 🐛 Error Handling\n\n```tsx\nconst speechToText = useSpeechToText();\n\n// Check for errors\nif (speechToText.error) {\n  // Common errors:\n  // - \"no-speech\": No speech detected\n  // - \"audio-capture\": Microphone not accessible\n  // - \"not-allowed\": Permission denied\n  // - \"network\": Network error\n  console.error('Error:', speechToText.error);\n}\n```\n\n## 📝 TypeScript Support\n\nAll components are fully typed. Import types:\n\n```typescript\nimport type {\n  SpeechToTextConfig,\n  SpeechToTextCallbacks,\n  SpeechToTextInstance,\n  SpeechToTextResult,\n  SpeechToTextUIProps,\n} from 'promptica-speech-to-text';\n```\n\n## 🔒 Permissions\n\nThe browser will request microphone permission on first use. Ensure your site is served over HTTPS in production.\n\n## 🎭 Library vs Demo Mode\n\n### As a Library (Production)\nWhen users install your library, **no HTML elements are required**:\n\n```tsx\n// User's app - no HTML element needed!\nimport { useSpeechToText, SpeechToTextUI } from 'promptica-speech-to-text';\n\nfunction UserApp() {\n  const speech = useSpeechToText();\n  \n  // User mounts wherever they want\n  return <SpeechToTextUI instance={speech} showUI={true} />;\n}\n```\n\n### Demo Mode (Development)\nWhen running `pnpm dev` for testing, it automatically mounts to `<div id=\"root\">` which is already in `index.html`. This doesn't affect library users at all!\n\n📖 **[See detailed explanation](./LIBRARY_VS_DEMO.md)**\n\n## 📚 Advanced Usage\n\n### Custom Styling\n\nThe UI component accepts className props for custom styling:\n\n```tsx\n<SpeechToTextUI\n  className=\"my-container\"\n  buttonClassName=\"my-button\"\n  textareaClassName=\"my-textarea\"\n/>\n```\n\nOr use inline styles by modifying the styles object in `speechToTextUi.tsx`.\n\n### Dynamic Configuration\n\nUpdate configuration on the fly:\n\n```tsx\nconst speechToText = useSpeechToText();\n\n// Change language\nspeechToText.setConfig({ language: 'es-ES' });\n\n// Enable continuous mode\nspeechToText.setConfig({ continuous: true });\n\n// Multiple configs at once\nspeechToText.setConfig({\n  language: 'fr-FR',\n  continuous: false,\n  interimResults: true,\n});\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Feel free to submit issues and pull requests.\n\n## 📄 License\n\nMIT License - feel free to use in your projects!\n\n## 🙏 Acknowledgments\n\nBuilt with React and the Web Speech API. Special thanks to the open-source community.\n\n---\n\nMade with ❤️ by Promptica\n","readmeFilename":"README.md"}