Get started

Install @ovok/core, configure the Ovok client, and make a first request.

  • Stable unknown
  • Release candidate since 0.4.49-rc.2
  • Development since 0.4.49-dev.493+062a3db

Complexity: 1 of 5 · Client: Web and Node.js (@ovok/core) · Time: about 5 minutes

Install the packageClient-side

You need an Ovok project and its tenant code. Add the SDK to your application:

npm install @ovok/core

The package root exports the Ovok client and its types. React components and hooks come from the separate @ovok/core/react entry.

Create a clientClient-side

Create one client and reuse it for every request.

  • baseUrl is the Ovok API origin.
  • tenantCode selects the tenant for session storage and requests.
ovok.ts
import { Ovok } from '@ovok/core';

export const ovok = new Ovok({
  baseUrl: 'https://api.sandbox.ovok.com',
  tenantCode: '{{TENANT_CODE}}',
});

Client configuration lists the optional settings.

Check the connectionClient-side

Ask the Ovok API for its health. The response includes an ok flag and the status of each dependency.

const health = await ovok.health.check();

if (!health.ok) {
  throw new Error('Ovok API is not healthy');
}

A healthy API confirms the connection only. It does not grant access to project data.

Test your integration

  1. Run the health check from the previous step.
  2. Confirm that health.ok is true.
  3. If the call rejects, read the error class. Errors and retries explains each one.
ScenarioHow to trigger itExpected result
The API answersUse https://api.sandbox.ovok.com as baseUrlhealth.ok is true
The API cannot be reachedPoint baseUrl at a host that does not answerThe call rejects with OvokConnectionError

See also

Last updated on

On this page