The Ovok client

Use the @ovok/core package root for Node, browsers and React Native.

  • Stable unknown
  • Release candidate since 0.4.49-rc.2
  • Development since 0.4.49-dev.501+330a19b

@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

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. A bad option throws OvokConfigError from the constructor, not from the first request.

Namespaces

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

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: 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.

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

Last updated on

On this page