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 carryingstatus,code,message,requestIdanddetails. See errors. - A property left
undefinedis omitted from the request; an explicitnullis sent (for examplettlSeconds: nulldisables auto-stop). createSandboxandforkSandboxtake an idempotency key option.deleteSandboxsends the confirm header for you.
Methods
| Method | Route |
|---|---|
createSandbox, listSandboxes, getSandbox, updateSandbox | POST/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.