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.
| Option | Required | Notes |
|---|---|---|
baseUrl, tenantCode | Yes | See the JavaScript SDK's next-client guide. |
secureStore | Yes | expo-secure-store, or anything with getItemAsync, setItemAsync and deleteItemAsync. |
secureStoreOptions | No | Passed to every SecureStore call, such as { keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK } for background launches. |
getRandomValues | No | Used only when the runtime has no crypto.getRandomValues. Sign-in needs one. |
fhirPath, clientId, fetch, timeoutMs, maxNetworkRetries, onUnauthenticated | No | See 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.
| Module | Next import | API reference |
|---|---|---|
| UI | @ovok/native/next/ui | UI |
| Theme | @ovok/native/next/theme | Theme |
| Tile | @ovok/native/next/tile | Tile |
| Picker sheet | @ovok/native/next/picker-sheet | Picker sheet |
| Progress ring | @ovok/native/next/progress-ring | Progress ring |
| Progress bar | @ovok/native/next/progress-bar | Progress bar |
| Breathing exercise | @ovok/native/next/breathing-exercise | Breathing exercise |
| Journal | @ovok/native/next/journal | Journal |
| Diary | @ovok/native/next/diary | Diary |
| Observation detail | @ovok/native/next/observation-detail | Observation detail |
@ovok/native/next/pdf | ||
| Image | @ovok/native/next/image | Image |
| Tab | @ovok/native/next/tab | Tab |
| Setting | @ovok/native/next/setting | Setting |
| Language switcher | @ovok/native/next/language-switcher | Language switcher |
| CMS | @ovok/native/next/cms | CMS |
| Content | @ovok/native/next/content | Content |
| Measurement | @ovok/native/next/measurement | Measurement |
| Patient | @ovok/native/next/patient | Patient |
API reference
Every export of @ovok/native/next, with signatures, props and types, is in the next API reference.
Last updated on