Skip to main content
The Nullspace TypeScript SDK (@nullspace/sdk) gives you on-demand Linux machines from Node or the browser. Its public surface mirrors the Python SDK camelCased — same resource names, same namespacing, same error semantics — so one mental model teaches both languages.

Install

Requires Node 18+. WebSocket-backed surfaces (PTY, exec streaming, lifecycle events) need a global WebSocket, which Node 22+ and all browsers provide.

Configure

Authentication resolves from explicit options first, then the environment:
  • NULLSPACE_API_KEY — required API key.
  • NULLSPACE_API_URL (alias NULLSPACE_BASE_URL) — base URL.

Quickstart

Create → exec → file → destroy, in under 10 lines:

Resources

A Machine exposes namespaced resources, mirroring Python:
  • machine.commandsrun (with onStdout / onStderr streaming), list, kill, sendStdin, getLogs.
  • machine.filesread, write, list, exists, info, makeDir, remove, rename, upload / download with progress callbacks.
  • machine.ptyopen() returns a handle (send input, resize, async-iterate output, wait(), kill()).
  • machine.coderun() streams Jupyter-style execution events over SSE.
  • machine.lifecyclelist() history and subscribe() live events.
Lifecycle and advanced primitives live on the machine or client:

Errors

Every failure is a typed subclass of MachineError with a stable code, matching the Python hierarchy: NotFoundError, AuthError, ConflictError, QuotaExceededError, RateLimitError, TimeoutError, BuildError, FileUploadError, and more.

Browser support

The REST and SSE core works in browsers; WebSocket (PTY, exec streaming, lifecycle) and filesystem-path helpers are Node-first. WebSocket routes authenticate with the nullspace-api-key subprotocol so browsers work without setting headers. See the package README for the full support matrix.

Not included

The MCP server and CLI remain Python-owned (nullspace-sdk[cli,mcp]). Some advanced REST domains the Python SDK exposes are not yet wrapped in the TypeScript surface; the per-operation coverage manifest lives in specs/client-surfaces/typescript-sdk.yaml.