Skip to main content

Nvisy

The client class. All services are exposed as lazily-constructed properties.
The constructor takes a single ClientConfig object.

ClientConfig

DEFAULTS and VERSION are exported for reference.

Services

Most methods take workspaceSlug as their first argument. Workspaces are the top-level tenancy boundary.

Workspaces

Files

uploadFiles accepts a single Blob or an array, and sends them as multipart/form-data. downloadFile returns the raw Response so you can stream the body.

Pipelines

Policies

Runs

createRun starts detection over a single file:
events returns a server-sent events stream of RunStatusEvent values for live progress. redact applies redactions once you are satisfied with the detections.

API Tokens

createApiToken returns the JWT exactly once. Store it immediately — it cannot be retrieved later.

Authentication

Pagination

List methods are cursor-paginated and accept CursorPagination:

Errors

NvisyError is the base class. NvisyApiError extends it for API responses: Helpers: isClientError() (4xx), isServerError() (5xx), isRetryable().
isRetryable() reports that the error is of a transient kind, not that the operation is safe to repeat. Retry automatically only for reads or for requests carrying an idempotency key.

Idempotency Keys

createRun accepts an Idempotency-Key header: repeating a request with the same key returns the existing run instead of starting a second one. Generate one key per logical run and reuse it across every retry of that run.
Generating a fresh key inside the retry loop defeats the purpose — each attempt would then look like a new run.