# Speech Recognition URL: /docs/native/expo/speech-recognition Setting up expo-speech-recognition for useSpeechRecognition and the DocyrusAgent microphone button. ## Overview [`useSpeechRecognition`](/docs/native/hooks/use-speech-recognition) and the DocyrusAgent mic button (`DocyrusAgentChatInputMicButton` / `DocyrusAgentChatInputMic`) use `expo-speech-recognition`. It is an **optional peer**: without it (and always in **Expo Go**, which cannot load its native code) the hook reports `isSupported: false` and the mic button is hidden, so the rest of the chat keeps working. ## Installation ```bash npx expo install expo-speech-recognition ``` **Dependencies:** - [expo-speech-recognition](https://www.npmjs.com/package/expo-speech-recognition) ### Expo Configuration Add the config plugin, then create a development build (`npx expo run:ios` / `eas build --profile development`): ```ts { plugins: [ [ 'expo-speech-recognition', { microphonePermission: 'Allow $(PRODUCT_NAME) to use the microphone for voice prompts.', speechRecognitionPermission: 'Allow $(PRODUCT_NAME) to transcribe your voice prompts.' } ] ] } ``` The plugin writes `NSMicrophoneUsageDescription` / `NSSpeechRecognitionUsageDescription` on iOS and `RECORD_AUDIO` on Android. Permissions are requested on the first `start()`. ## Behaviour | Situation | `isSupported` | Mic button | |-----------|---------------|------------| | Dev / production build with the module | `true` | Visible | | Expo Go | `false` | Hidden | | Module not installed | `false` | Hidden | | Device reports recognition unavailable | `false` | Hidden | | Permission denied | `true` (`error = 'not-allowed'`) | Visible, recording doesn't start |