@ohm_studio/sdk-react-native
v0.12.0
Published
OHM Studio SDK for React Native. Voice-to-structured-JSON clinical extraction APIs in your mobile app.
Downloads
2,050
Maintainers
Readme
OHM RN SDK · @ohm_studio/sdk-react-native
The short name is
OHM RN SDK. The full npm name is@ohm_studio/sdk-react-native— that's what you install. Both names refer to the same package.
OHM Studio SDK for React Native / Expo — voice-to-structured-JSON clinical extraction inside your mobile app. Multi-language STT, FHIR-shaped outputs, formulary-aware prescriptions.
For web / Node, install
@ohm_studio/sdk(OHM SDK) instead.
Install
npm install @ohm_studio/sdk-react-native
# or
pnpm add @ohm_studio/sdk-react-native
# or
yarn add @ohm_studio/sdk-react-nativeQuickstart
import { OHM } from "@ohm_studio/sdk-react-native";
// IMPORTANT: live keys (ohms_live_*) MUST NOT ship in your bundle.
// Use ohms_test_* for local dev, or proxy through your backend.
const ohm = new OHM({
apiKey: TEST_KEY, // ohms_test_*
baseUrl: "https://api.ohm.doctor",
acknowledgeBundledKey: true, // dev-only override
});
// Audio → structured JSON in one call
// `transcript` is always English — Tamil, Hindi, Telugu, Bengali, or any
// code-mixed consult is translated server-side before extraction runs.
const { transcript, data } = await ohm.audio.extract({
apiSlug: "opd-clinic",
file: { uri: localUri, name: "rec.m4a", type: "audio/mp4" },
});Capturing audio
@ohm_studio/sdk-react-native doesn't ship a recorder — pair with whichever you prefer:
| Library | Notes |
|--------------------------------------|--------------------------------------------------|
| expo-av | Easiest in Expo apps. Returns a local URI. |
| react-native-audio-recorder-player | Bare RN. Configurable codec / bitrate. |
Whichever you use, pass the resulting { uri, name, type } to ohm.audio.extract.
React hooks
import { OHM } from "@ohm_studio/sdk-react-native";
import { OhmProvider, useOhmAudioExtract } from "@ohm_studio/sdk-react-native/react";
const ohm = new OHM({ apiKey: TEST_KEY, acknowledgeBundledKey: true });
export default function App() {
return (
<OhmProvider client={ohm}>
<Recorder />
</OhmProvider>
);
}Cancellation, upload progress, and discovery (v0.6+)
Every method accepts signal?: AbortSignal. audio.transcribe and
audio.extract accept onProgress. ohm.apis.list() enumerates
published APIs.
const controller = new AbortController();
const { data } = await ohm.audio.extract({
apiSlug: "opd-clinic",
file: { uri, name: "rec.m4a", type: "audio/mp4" },
signal: controller.signal,
onProgress: ({ percent }) => setProgress(percent),
});
const apis = await ohm.apis.list();The React hooks (useOhmExtract, useOhmAudioExtract,
useOhmSummarize, useRecorder) auto-abort on unmount and on the next
mutation. Aborts surface as OHMAbortError (code: "aborted") —
pattern match to ignore them.
Typed data with the Studio CLI
Pair with @ohm_studio/cli
to generate TypeScript interfaces from your Studio schemas:
npm install -D @ohm_studio/cli
npx ohm-studio pull-all --out src/ohmProduction: proxy your backend
Don't ship live keys. Run a tiny proxy on your backend that holds the live key and forwards requests from your RN app (authenticated with your existing session token). Documented at docs.ohm.doctor/security/rn-key-handling.
License
MIT
