Get started with the React Native SDK
Install @ovok/native, connect to the sandbox, sign in, and make a first request.
Install
npm install @ovok/native @ovok/coreInstall the peer dependencies for the APIs you import; see Installation and native setup. The SDK needs a native build, not Expo Go.
Create a client
Keep the client outside any component and provide it at the app root:
import { OvokProvider } from "@ovok/core/next/react";
import { Ovok } from "@ovok/native/next";
import * as SecureStore from "expo-secure-store";
const client = new Ovok({
baseUrl: "https://api.sandbox.ovok.com",
tenantCode: "your-patient-tenant-code",
secureStore: SecureStore,
});
// Wrap your app: <OvokProvider client={client}>…</OvokProvider>Sign in
import { SignIn } from "@ovok/native";
<SignIn>
<SignIn.EmailForm
loginType="Patient"
tenantCode="your-patient-tenant-code"
onSuccess={() => router.replace("/home")}
onError={(error) => Alert.alert("Sign-in failed", error.message)}
>
<SignIn.EmailForm.Inputs />
<SignIn.EmailForm.SigninButton />
</SignIn.EmailForm>
</SignIn>The screen needs the providers from App shell and providers.
Make a first request
import { useOvok } from "@ovok/core/next/react";
const client = useOvok();
const patient = await client.fhir.read("Patient", "patient-id");Next: full React Native SDK docs, starting with the quick start.
Last updated on