react-native-deepgram
Version:
React Native SDK for Deepgram's AI-powered speech-to-text, real-time transcription, and text intelligence APIs. Supports live audio streaming, file transcription, sentiment analysis, and topic detection for iOS and Android.
23 lines (19 loc) • 548 B
text/typescript
import { NativeModules } from 'react-native';
interface DeepgramNative {
startRecording(): Promise<void>;
stopRecording(): Promise<void>;
startAudio(): Promise<void>;
stopAudio(): Promise<void>;
playAudioChunk(chunk: string): Promise<void>;
}
const LINKING_ERROR = `react-native-deepgram: Native code not linked—did you run “pod install” & rebuild?`;
export const Deepgram: DeepgramNative =
NativeModules.Deepgram ??
(new Proxy(
{},
{
get() {
throw new Error(LINKING_ERROR);
},
}
) as any);