npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@daytona/use-computer

v0.1.16

Published

TypeScript SDK for use.computer — rent dedicated macOS VMs built for computer-use agents.

Readme

@daytona/use-computer — TypeScript SDK

use.computer gives you macOS sandboxes: VMs on dedicated Apple M4 Mac minis that you reserve for 24 hours or more, up to 2 VMs at a time per Mac. Parity with the Python SDK; async-native.

npm install @daytona/use-computer
export USE_COMPUTER_API_KEY=uc_live_...

Quickstart

Flow: sign up → $100 starter credit → reserve a Mac mini (dashboard, or client.reserve(hours=24) in the SDK) → create() a macOS sandbox → drive it (mouse, keyboard, screenshot, exec, files, recording, UI tree, VNC) → delete(). The gateway configures the hourly price for each Mac model; check the live dashboard before reserving. The starter credit pays for reservations, and each reservation keeps its purchase rate.

import { Computer } from "@daytona/use-computer";

const computer = new Computer(); // baseUrl + apiKey from env, or pass {baseUrl, apiKey}

// 1. Reserve one M4 Mac Mini for 24 hours
const reservation = await computer.reserve({ hours: 24, macModel: "m4" });

// 2. Launch a macOS sandbox on the reserved Mac
const mac = await computer.create({ reservationId: reservation.reservation_id });

try {
  // 3. Drive the macOS sandbox
  await mac.exec("open -a Safari");
  await mac.keyboard.type("hello from use.computer");
  await mac.mouse.click(500, 500);
  const png = await mac.screenshot.takeFullScreen();
  console.log("Sandbox:", mac.sandboxId);
  console.log("Open this sandbox in the use.computer dashboard console.");
} finally {
  await mac.close();
}

Treat vncUrl as an account credential: never print it, paste it into support tickets, or include it in logs or process arguments. Open the viewer through the dashboard console.

Gateway URLs (including USE_COMPUTER_BASE_URL) must use HTTPS, except HTTP on loopback hosts (localhost, 127.0.0.0/8, or ::1). Authenticated requests reject redirects rather than forwarding credentials.

Reservation purchases, sandbox creates (including snapshot restores), and snapshots use a fresh idempotency key per logical call. Timeout/network failures and transient HTTP 500/502/503/504/529 responses retry up to three times, two seconds apart, with the same key and exact body. Other mutations are sent once, and redirects are never retried. Gateway deduplication is live for purchases; create, snapshot, and restore support is being added in mmini-sandbox#118.

Surface

  • Computer.reserve({ hours?, miniCount?, macModel?, vmLayout? }) → reserve one Mac Mini from account credits. macModel is "m4" (the default; 10 vCPU and 16 GiB RAM), "m4-pro" (12 vCPU and 24 GiB RAM), or "m5-pro" (15 vCPU and 24 GiB RAM); the response reports reservation.mac_model. vmLayout is deprecated and sent only when you pass it: "split" (the server default) allows two sandboxes, and "whole" allows one sandbox at a time.
  • Computer.create({ reservationId?, host?, snapshot?, ephemeral?, cpu?, memoryGib?, diskGib? }) → MacOSSandbox. Omitting ephemeral uses the server default: the reservation lifetime. Explicit true opts into destruction after 2 idle minutes; explicit false disables idle destruction. Call sandbox.keepalive() during idle periods when opting in. Omitted cpu, memoryGib, and diskGib select an available warm VM and start right away. Split warm VMs have 5 vCPU/8 GiB on M4, 6 vCPU/12 GiB on M4 Pro, and either 8 vCPU/12 GiB or 7 vCPU/12 GiB on M5 Pro; whole warm VMs have 10 vCPU/16 GiB, 12 vCPU/24 GiB, and 15 vCPU/24 GiB respectively. The response reports the selected slot's actual CPU and memory. Any other size boots a new VM, which can take up to 5 minutes, so the create waits up to 10 minutes when you set any of them. A Mac runs at most 2 sandboxes at a time, and their sizes must fit in the Mac. The sandbox reports cpu, memoryGib, diskGib, and boot ("warm" or "cold"). A refused size throws SandboxResourcesError with code (invalid_resources, resources_exceed_mac, sandbox_limit_reached, or insufficient_capacity), message, and status.
  • Computer.platforms(reservationId?) → discover available platforms and capacity. For Mac reservations, macos.capacity reports max and used macOS VMs.
  • Computer.snapshots() → list saved macOS snapshot versions.
  • MacOSSandbox:
    • mouse.move(x, y), mouse.click(x, y, button?), mouse.doubleClick(x, y), mouse.scroll(x, y, direction, amount), mouse.drag(startX, startY, endX, endY, button?), mouse.position()
    • keyboard.type(text), keyboard.press(key), keyboard.hotkey(keys)
    • screenshot.takeFullScreen(), screenshot.takeCompressed()
    • recording.start(), recording.stop(id), recording.listAll(), recording.download(id)
    • permissions.allowAutomation({ bundleIds?, installed? }) → { success, targets, changed }
    • exec(cmd) / execSsh(cmd) → run command via SSH
    • upload(bytes, path), download(path)
    • uiTree() → native UI tree
    • snapshot(name) → capture disk state to boot future sandboxes instantly
    • keepalive(), close(), delete()

Docs: docs.use.computer.

Install from source when publication is unavailable

The npm package lives in js/, not the repository root. Check out the full commit SHA containing the feature you need, then build and pack that subdirectory:

git clone https://github.com/daytona/use-computer-sdk.git
git -C use-computer-sdk checkout FULL_COMMIT_SHA
npm --prefix use-computer-sdk/js ci
npm --prefix use-computer-sdk/js run build
npm pack ./use-computer-sdk/js
npm install ./daytona-use-computer-0.1.0.tgz

Replace the final filename with the tarball filename printed by npm pack (the checkout's package version determines it). Run the install command in your application directory with the corresponding tarball path. Do not install the repository root as an npm Git dependency: it has no root package. For reservation purchases without a newer SDK, see the REST fallback.

Native computer actions

mouse.click(x, y, "middle", 3) sends one native triple-click sequence. mouse.down(button) and mouse.up(button) hold/release at the current cursor; optional x/y move to that position first. keyboard.hold("shift", 0.5) holds keys for seconds. mouse.drag([[x1, y1], [x2, y2], [x3, y3]]) preserves each path point. Numeric mouse.scroll(x, y, dx, dy) sends both pixel deltas, positive right/down. Coordinates are screenshot pixels; Control and Command are distinct.

Application automation permissions

macOS asks for consent when a process sends Apple events through AppleScript or osascript. That dialog cannot be answered inside the sandbox. The gateway approves every installed application when creating a sandbox or restoring a snapshot. After installing another application, approve it before scripting it:

await mac.exec("brew install --cask google-chrome");
const result = await mac.permissions.allowAutomation({
  bundleIds: ["com.google.Chrome"],
});
console.log(result.success, result.targets, result.changed);
await mac.exec(`osascript -e 'tell application "Google Chrome" to activate'`);

Use { installed: true } to approve all currently installed applications, or combine it with bundleIds to include specific targets. These permissions cover osascript, SSH sessions, exec, and Terminal.

The method sends POST /v1/sandboxes/{sandboxID}/permissions/automation, mapping bundleIds to bundle_ids. Supply bundle IDs, installed: true, or both. The typed AllowAutomationResult contains success: boolean and integer counts targets and changed; the request type is AllowAutomationOptions. The gateway validates bundle IDs against ^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$ and rejects malformed IDs or an empty request with HTTP 400 { error: ... }, surfaced as the standard UseComputerError. The SDK does not validate locally.