Installation
fetch API). Zero runtime dependencies.
Quick Start
Configuration
execute() method always uses a 120-second timeout, regardless of the client timeout.
Method Reference
Desktop CRUD
| Method | Returns | Description |
|---|---|---|
createDesktop(desktopType?) | Promise<Desktop> | Create a new desktop ("sandbox" by default) |
listDesktops() | Promise<Desktop[]> | List all active desktops |
getDesktop(desktopId) | Promise<Desktop> | Get a single desktop by ID |
updateDesktop(desktopId, { name }) | Promise<Desktop> | Rename a desktop |
deleteDesktop(desktopId) | Promise<DeleteResponse> | Delete a desktop |
Computer-Use Helpers
Typed shortcuts — no need to know the wire format:| Method | Description |
|---|---|
screenshot(desktopId) | Take a screenshot |
leftClick(desktopId, x, y) | Left click at coordinate |
rightClick(desktopId, x, y) | Right click at coordinate |
doubleClick(desktopId, x, y) | Double click at coordinate |
middleClick(desktopId, x, y) | Middle click at coordinate |
mouseMove(desktopId, x, y) | Move cursor to coordinate |
typeText(desktopId, text) | Type text |
keyPress(desktopId, key) | Press a key or combo (e.g. "ctrl+a") |
scroll(desktopId, x, y, { direction, amount? }) | Scroll at coordinate |
cursorPosition(desktopId) | Get current cursor position |
Tool Execution
| Method | Returns | Description |
|---|---|---|
execute(desktopId, { tool, action, params? }) | Promise<ExecuteResult> | Execute any tool action (raw) |
listTools(desktopId) | Promise<ToolSchema[]> | List available tools as JSON Schema |
getToolLogs(desktopId) | Promise<unknown[]> | Get tool execution logs |
Sessions
| Method | Returns | Description |
|---|---|---|
createSession(desktopId) | Promise<SessionInfo> | Create or reconnect an RDP session |
getSession(desktopId) | Promise<SessionInfo> | Get current session status |
deleteSession(desktopId) | Promise<void> | Disconnect the session |
Files
Per-desktop shared drive (EFS-backed; persists across controller rebinds; 100 MiB upload cap). All three methods accept an optionaloptions.path that selects a subdirectory; uploadFile creates missing intermediate directories on the server.
| Method | Returns | Description |
|---|---|---|
listFiles(desktopId, options?) | Promise<File[]> | List files on the desktop’s drive. Entries have isDir: true for directories. |
uploadFile(desktopId, name, body, options?) | Promise<UploadFileResponse> | Upload Uint8Array / ArrayBuffer / string / Blob; options.contentType defaults to application/octet-stream. |
downloadFile(desktopId, name, options?) | Promise<Uint8Array> | Download a file as raw bytes. |
File interface shadows the DOM File — if you need both, alias it: import type { File as NenFile } from "nen-sdk-js".
Error Handling
All API errors throwNenDesktopError, which carries statusCode and responseBody:
e.statusCode to differentiate (401, 404, 409, 5xx).