React Native SDK
A customizable WebRTC SDK for React Native that supports Expo. This package provides components for building real-time audio applications with KrosAI in React Native.
🚀 Installation
Install required dependencies:
For Expo projects, configure the necessary permissions in your app.json
:
🛠️ Usage
Basic Example
📅 Components
⛰️ KrosaiWrapper
The base wrapper component that manages WebRTC connection and audio setup.
Props:
url: string
– Krosai WebSocket server URLtoken: string
– JWT token for authenticationonConnected?: () => void
– Callback when successfully connectedonDisconnected?: () => void
– Callback when disconnectedonError?: (error: Error) => void
– Callback for connection errorsstyle?: ViewStyle
– Custom styles for the container
🗣️ VoiceAssistant
A higher-level component that adds voice assistant functionality.
Props:
url: string
– Krosai WebSocket server URLtoken: string
– JWT token for authenticationonMessage: (message: string) => void
– Callback for received messagesstyle?: ViewStyle
– Custom styles for the container
✨ Features
Expo compatibility
Audio permission handling
Mute/unmute functionality
Real-time message handling
Customizable styling
TypeScript support
⚡ Requirements
React Native v0.73.2 or higher
Expo SDK 50 or higher
iOS 13.0+
Android 5.0+
Last updated