Skip to main content

Configure the client

OvokClient extends MedplumClient. It accepts Medplum's client options and adds a small number of Ovok options. Keep the environment and storage choices explicit so every part of the app uses the same authenticated client.

API origin and FHIR path​

import { OvokClient } from '@ovok/core';

const client = new OvokClient({
baseUrl: 'https://api.sandbox.ovok.com',
fhirUrlPath: '/fhir/R4/',
});

baseUrl is the API origin. fhirUrlPath is the FHIR path used by the inherited client. apiUrl is not an OvokClient option. Keep the trailing slash in the FHIR path as shown.

Ovok's FHIR resources, search behavior, and operation availability are backend contracts. Start with FHIR basics and the FHIR R4 reference.

Storage and login state​

Pass a Medplum-compatible storage adapter when the application needs persistent client state. The same durable adapter is required for the optional offline measurement queue. Choose storage to match your app's security and lifecycle requirements; do not treat browser storage as a replacement for server-side access control.

const client = new OvokClient({
baseUrl: 'https://api.sandbox.ovok.com',
fhirUrlPath: '/fhir/R4/',
storage,
});

storage above is the adapter your application provides. See offline measurements before enabling queued writes.

Optional client options​

OptionPurpose
socialLoginClientIdClient identifier used by the SDK's social login methods.
offlineQueueOpt in to durable measurement queuing and configure retry behavior.
storageMedplum-compatible client storage; required when the offline queue is enabled.

Use authentication for sign-in methods, project settings and features for server-side project configuration, and access policies for what authenticated users may read or write.

Discover the selected environment​

const statement = await client.getCapabilityStatement('R4');
const endpoints = await client.getPublicApiEndpoints('R4');

Use these calls during development or diagnostics to inspect what the connected server advertises. They do not replace backend authorization checks, and they do not guarantee that a feature is enabled for a particular project.