Installation and platform setup
Requirements
| Runtime | Minimum |
|---|---|
| React Native | 0.72 |
| iOS | 15.1 |
| Android | API 24 |
| Web | Browser with WebAssembly |
| Node for tooling | 20 recommended |
Install
npm install @kittentts/react-native
The package installs onnxruntime-react-native, onnxruntime-web, its filesystem dependency, the CE phonemizer runtime, and model loaders. Do not register ONNX Runtime manually.
Expo development build
npx expo install expo-audio expo-dev-client
npx expo prebuild
npx expo run:ios
For Android:
npx expo run:android
After installing the native development build, use:
npx expo start --dev-client
Bare React Native
Generation needs no playback package. For speak() with React Native Sound:
npm install react-native-sound
cd ios && pod install && cd ..
React Native Web
The package export map selects its browser entrypoint. The web path uses ONNX Runtime Web, Cache API storage when available, and the JavaScript CE phonemizer.
import {KittenTTS, createBrowserAudioPlayer} from '@kittentts/react-native';
const tts = await KittenTTS.create({player: createBrowserAudioPlayer()});
await tts.speak('Hello from React Native Web.');
Pinned ONNX Runtime Web assets load from jsDelivr by default. For production CDN independence, self-host them and set ortWasmPath.