Skip to main content
The TypeScript SDK has one asynchronous NdiClient. Every network method returns a Promise, so the same client works for sequential calls, concurrent batches, and server applications.

Basic usage

Unlike the Python SDK, there is no separate async client and no synchronous client. Use await for one operation and Promise utilities for concurrency.

Process documents concurrently

Share one client across tasks. Each operation creates its own job, and each jobs.wait polls independently.

Limit concurrency

For large batches, use a small worker pool so your application does not submit every file at once.
Each worker holds one complete upload, submission, and wait cycle at a time. This bounds the number of active jobs without adding another package.

Handle partial batch failures

Promise.all rejects when one task rejects. Use Promise.allSettled when each document should succeed or fail independently.
See Error handling for typed HTTP and job errors.

Client lifecycle

close() is currently a no-op because fetch has no client resource to close. One NdiClient can be shared for the lifetime of an application.

When to use concurrency

Run concurrently

Independent documents, server request handlers, and batches where waiting on one job should not block submission of another.

Run sequentially

One-off scripts or dependent operations where the next request needs the previous result.

Next steps