Kabin

TypeScript SDK

Status: planned, not published yet. The package name will be @kabin/sdk on npm. Until then use the HTTP example in the quickstart; it needs only Node 22 and fetch.

Install and configure

npm install @kabin/sdk    # not available yet

The client reads KABIN_API_KEY and KABIN_API_URL (default https://api.kabin.dev). Node 18 or newer (global fetch), ESM only, no runtime dependencies.

Conventions

  • Asynchronous client; method names and fields are camelCase and match the wire format.
  • Every response is unwrapped from the {ok, type, ...} envelope; a failed call rejects with an error object carrying status, code, message, requestId and details. See errors.
  • A property left undefined is omitted from the request; an explicit null is sent (for example ttlSeconds: null disables auto-stop).
  • createSandbox and forkSandbox take an idempotency key option. deleteSandbox sends the confirm header for you.

Methods

Client methods and the routes they call
MethodRoute
createSandbox, listSandboxes, getSandbox, updateSandboxPOST/GET /sandboxes, GET/PATCH /sandboxes/{id}
stopSandbox, resumeSandbox, forkSandbox, deleteSandbox/stop, /resume, /fork, DELETE /sandboxes/{id}
command, commandStatus, killCommand/commands
readFile, writeFile, deleteFile, listFiles/files, /files/list
saveSnapshot, listSavedSnapshots, getSavedSnapshot, deleteSavedSnapshot/saved-snapshots
me, limits, getUsage, injectSshKey/me, /limits, /usage, /sshkey

Helpers

waitUntilReady, execCommand (synchronous, retries retryable 502s), streamCommand (async iterator over the NDJSON frames, cancelable with an AbortSignal), runCommand (detached command with offset-based polling), readText / writeText and stopAndRemove.

The constructor and import names are final when the package is published; the package README is then authoritative.