Polyfills and runtime setup
The polyfill APIs are exported from the package root because they must run before the
client is created. They are backed by @medplum/expo-polyfills.
import {
ExpoClientStorage,
polyfillMedplumWebAPIs,
} from "@ovok/native";
polyfillMedplumWebAPIs();
const storage = new ExpoClientStorage();
Public exports
| Export | Purpose |
|---|---|
polyfillMedplumWebAPIs | Installs the web APIs required by the mobile Medplum/Ovok client |
cleanupMedplumWebAPIs | Removes the installed polyfills for tests or controlled teardown |
ExpoClientStorage | Client storage implementation backed by Expo storage primitives |
ExtendedExpoCrypto | Expo-compatible crypto implementation |
IExpoClientStorage | Storage adapter type |
PolyfillEnabledConfig | Optional polyfill configuration type |
initWebSocketManager | Initializes the WebSocket manager used by the client runtime |
Call polyfillMedplumWebAPIs once from the application entry point, before creating
or using OvokClient. Do not call it during render or once per screen. Use
cleanupMedplumWebAPIs only when a test or controlled runtime teardown needs to remove
the globals.
Storage and credentials
ExpoClientStorage provides the client storage boundary; it does not decide which
account or patient is active. For credentials needed after an Android background
relaunch, use the dedicated adapter from
@ovok/native/background-sync.
Public import boundary
There is no documented @ovok/native/polyfills subpath in the package export map.
Import these APIs from @ovok/native even when the rest of the app uses focused
subpaths.