GuidesModules

The next client (preview)

@ovok/native/next: the @ovok/core/next contract with sessions kept in the device's secure store.

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

@ovok/native/next is the React Native edition of @ovok/core/next. It exports the same client API, keeps sessions in the device's secure store and supplies the crypto.getRandomValues that Hermes lacks. The native auth, CMS, questionnaire, image, socket, and health-sync modules use this client through OvokProvider from @ovok/core/next/react.

The Flutter SDK follows this contract, so its names match.

Create a client

import * as Crypto from 'expo-crypto';
import * as SecureStore from 'expo-secure-store';
import { Ovok } from '@ovok/native/next';

export const ovok = new Ovok({
  baseUrl: 'https://api.sandbox.ovok.com',
  tenantCode: 'your-tenant',
  secureStore: SecureStore,
  getRandomValues: Crypto.getRandomValues,
});

Mount one provider above the native modules:

import { OvokProvider } from '@ovok/core/next/react';

<OvokProvider client={ovok}>
  <App />
</OvokProvider>;

Health import reads the signed-in Patient from this session. It stores each provider cursor under the current tenant, project, and patient. A background Health Connect task must restore the same native client session and pass the matching patientId to runAndroidHealthConnectSync; the task refuses to import for another patient.

OptionRequiredNotes
baseUrl, tenantCodeYesSee the JavaScript SDK's next-client guide.
secureStoreYesexpo-secure-store, or anything with getItemAsync, setItemAsync and deleteItemAsync.
secureStoreOptionsNoPassed to every SecureStore call, such as { keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK } for background launches.
getRandomValuesNoUsed only when the runtime has no crypto.getRandomValues. Sign-in needs one.
fhirPath, clientId, fetch, timeoutMs, maxNetworkRetries, onUnauthenticatedNoSee the JavaScript SDK's next-client guide.

There is no clientSecret: anything shipped inside an app can be extracted from it.

Secure storage

  • Chunking: SecureStore warns past 2048 bytes per value, so each value is split across numbered entries.
  • Keys: characters SecureStore rejects in a key, such as :, are written as _.
  • Locked keychain: a read rejected before first unlock counts as "no session". The client never deletes anything because a read failed.

Bluetooth

Scanning, pairing, connecting and saving readings through this client are in Bluetooth on the next client.

Health data

Import HealthKit and Health Connect data through the @ovok/native/next/data-sync API. For Android headless imports and background-safe storage, see background sync on the next client.

The next client also persists measurement writes that cannot finish immediately. Retry them after connectivity returns with await ovok.measurements.offlineQueue.flush().

Everything else

Sign-in, FHIR, paging and errors work as in the JavaScript SDK's next client.

UI and content modules

These Next subpaths re-export the existing module APIs. Their previous import paths remain available.

ModuleNext importAPI reference
UI@ovok/native/next/uiUI
Theme@ovok/native/next/themeTheme
Tile@ovok/native/next/tileTile
Picker sheet@ovok/native/next/picker-sheetPicker sheet
Progress ring@ovok/native/next/progress-ringProgress ring
Progress bar@ovok/native/next/progress-barProgress bar
Breathing exercise@ovok/native/next/breathing-exerciseBreathing exercise
Journal@ovok/native/next/journalJournal
Diary@ovok/native/next/diaryDiary
Observation detail@ovok/native/next/observation-detailObservation detail
PDF@ovok/native/next/pdfPDF
Image@ovok/native/next/imageImage
Tab@ovok/native/next/tabTab
Setting@ovok/native/next/settingSetting
Language switcher@ovok/native/next/language-switcherLanguage switcher
CMS@ovok/native/next/cmsCMS
Content@ovok/native/next/contentContent
Measurement@ovok/native/next/measurementMeasurement
Patient@ovok/native/next/patientPatient

API reference

Every export of @ovok/native/next, with signatures, props and types, is in the next API reference.

Last updated on

On this page