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/coreThe 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.
baseUrlis the Ovok API origin.tenantCodeselects the tenant for session storage and requests.
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
- Run the health check from the previous step.
- Confirm that
health.okistrue. - If the call rejects, read the error class. Errors and retries explains each one.
| Scenario | How to trigger it | Expected result |
|---|---|---|
| The API answers | Use https://api.sandbox.ovok.com as baseUrl | health.ok is true |
| The API cannot be reached | Point baseUrl at a host that does not answer | The call rejects with OvokConnectionError |
See also
- The Ovok client: namespaces, paging and runtimes.
- Sign users in
- React integration
- Errors and retries
Last updated on