Skip to main content

Installation

Install the Nvisy SDK from npm:

NPM Package

View the package on npm

Requirements

  • Node.js 24 or later (or any ES2022+ runtime with fetch and a global File)
  • An API token — create one under API Tokens in your account settings
Uploads construct a File, which Node.js exposes globally. On a runtime without it, import it explicitly with import { File } from "node:buffer".

Your First Request

Construct a client with your API token and read your account:
Everything except authentication and account management is scoped to a workspace, identified by its id. List your workspaces first to find it.

Configuration

The constructor accepts additional options:
apiToken and session are mutually exclusive in the type. Use apiToken for server-side and CI use; use session: true in a browser app after the guest client has logged in, which sends the session cookies instead.

Signing In From a Browser

Login, signup, OIDC sign-in start, the deployment’s auth capabilities, and the health probes work without a token, so they live on a separate pre-auth client:

The Redaction Workflow

Redaction is a two-phase process: a detection first analyzes a document, then you create a redaction from it after reviewing the findings.
1

Upload a document

2

Start a detection against a pipeline

Creation returns immediately; analysis continues in the background.
3

Wait for analysis to finish

streamEvents yields the current status immediately, then each transition, and ends once the detection settles.
4

Review the analysis

5

Create a redaction

A pipeline defines how a document is analyzed, and a policy defines what is considered sensitive. Create them once, then reuse across detections. To analyze a document against policies directly, without a saved pipeline, use detections.createAdhocDetection(workspaceId, { documentId, policyIds }).
A detection moves through pending → executing → complete or failed. Redaction is a separate, repeatable action over a complete detection and does not change that status — each createRedaction call produces a new redaction.
The detection row in Postgres is the source of truth, so a missed broadcast is recoverable — re-read the detection with getDetection if a connection drops. Note that the native EventSource cannot send an Authorization header, which is why the SDK streams over fetch.

Next Steps

API Reference

Every service and method

Examples

End-to-end patterns