# The Ovok client

Canonical page: https://docs.ovok.com/web-sdk/core/next-client

`@ovok/core` exports the current `Ovok` client. The `@ovok/core/next` entry remains available for existing imports. Both entries use the same client and talk to the Ovok API directly in Node, browsers and React Native.

This client is also the contract the Java and Python SDKs follow, so the same API names are available in each language's idiom.

## Create a client [#create-a-client]

```ts
import { Ovok } from '@ovok/core';

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

Options such as `storage`, `timeoutMs` and `onUnauthenticated` are described in [Configure the client](/web-sdk/core/client-configuration). A bad option throws `OvokConfigError` from the constructor, not from the first request.

## Namespaces [#namespaces]

Each area of the Ovok API has its own namespace, and each has a guide page:

- [ovok.auth](/web-sdk/core/namespaces/auth) and [ovok.session](/web-sdk/core/namespaces/session): sign-in, registration, passwords, saved accounts and session changes. See also [Sign users in](/web-sdk/core/guides/sign-in).
- [ovok.fhir](/web-sdk/core/namespaces/fhir) and [ovok.realtime](/web-sdk/core/namespaces/realtime): FHIR reads, searches and writes, and websocket subscriptions.
- [ovok.patient](/web-sdk/core/namespaces/patient): the signed-in patient's appointments, care plans, questionnaires, devices and dashboard.
- [ovok.measurements](/web-sdk/core/namespaces/measurements): saving and reading measurements, with the offline queue.
- [ovok.questionnaires and ovok.questionnaireResponses](/web-sdk/core/namespaces/questionnaires): `$populate`, submit and `$extract`.
- [ovok.slim](/web-sdk/core/namespaces/slim): the care-home dashboard API.
- [ovok.signals](/web-sdk/core/namespaces/signals): Signals enablement, undeliverable residents and the Signals gateway.
- [ovok.projects](/web-sdk/core/namespaces/projects), [ovok.accounts](/web-sdk/core/namespaces/accounts) and [ovok.locales and ovok.localizations](/web-sdk/core/namespaces/localization).
- [ovok.cms](/web-sdk/core/namespaces/cms) and [ovok.content](/web-sdk/core/namespaces/content).
- [ovok.consent](/web-sdk/core/namespaces/consent), [ovok.invites](/web-sdk/core/namespaces/invites) and [ovok.sharing](/web-sdk/core/namespaces/sharing).
- [ovok.documents](/web-sdk/core/namespaces/documents), [ovok.videoCalls](/web-sdk/core/namespaces/videocalls), [ovok.ai](/web-sdk/core/namespaces/ai), [ovok.wearables](/web-sdk/core/namespaces/wearables), [ovok.email](/web-sdk/core/namespaces/email), [ovok.bots](/web-sdk/core/namespaces/bots) and [ovok.health](/web-sdk/core/namespaces/health).

Methods follow Stripe's verbs: `list`, `retrieve`, `create`, `update` (PUT), `patch`, `delete`, and plain verbs such as `acknowledge`, `accept` or `revoke`.

## Paging and request options [#paging-and-request-options]

- **Paging:** lists the server pages return a `PagePromise`. Await it for the first page, or `for await` over it for every item.
- **Request options:** every method takes `{ signal, timeoutMs }` as its last argument.
- **Errors:** every failure is an `OvokError`; see [Errors and retries](/web-sdk/core/errors-and-retries).

## Runtimes [#runtimes]

- **Bundlers, React Native and Node:** import from `@ovok/core`.
- **Existing imports:** `@ovok/core/next` remains an alias for the same client.
- **Deep imports:** existing `@ovok/core/dist/*` imports remain available.
- **React Native:** use `@ovok/native/next`, which supplies device storage and the `crypto.getRandomValues` polyfill that sign-in needs.
- **Node:** version 22 or later.

## Reference [#reference]

- [Ovok client API reference](/web-sdk/core/reference/core/ovok-client) and the [complete API reference](/web-sdk/core/reference/).
