Skip to main content
View on GitHub
View on NPM

Installation

Install the Hyperbrowser SDK via npm or yarn:

Quick Start

Initialize the client with your API key:

Configuration Options

TypeScript Support

The SDK is fully typed with TypeScript. Import types from @hyperbrowser/sdk/types:

Sandboxes

Sandbox APIs work in two layers. Sandbox control methods use your API key to create, inspect, connect to, and stop sandboxes. When you create or connect to a sandbox, the SDK also retrieves a sandbox-scoped runtime token and returns an authenticated SandboxHandle. Sandbox VM operations run inside that started sandbox and use the runtime token on the handle automatically. The SDK handles runtime token refreshes for you, so once you have a running SandboxHandle, you can call files, processes, terminal, networking, and snapshot methods without managing runtime auth yourself.

Sandbox Control

Use these methods to inspect existing sandboxes and discover reusable sandbox resources.

Details

List Sandboxes

List Images

List Snapshots

Get Sandbox Info

Lifecycle

Use these methods to create, connect to, and stop sandbox instances.

Create Sandbox

Use client.sandboxes.create(...) to start a sandbox from an image.

Start From A Snapshot

Start a new sandbox from a memory checkpoint.

Connect To A Running Sandbox

Use connect(...) to re-authenticate a running sandbox, refresh its runtime token, and return a SandboxHandle for runtime operations. If you already have a handle, call sandbox.connect() to re-authenticate it in place.

Stop Sandbox

Sandbox VM Operations

These methods operate on the sandbox VM itself when the sandbox is running.

Networking

Expose Port

Unexpose Port

Get Exposed URL

Processes

Run A Command

Use sandbox.exec(...) for one-shot commands. You can also pass a plain string like await sandbox.exec("node -v"). Commands are executed through /bin/sh -lc.
If stdout contains JSON, parse it explicitly:

Start A Process

Use sandbox.processes.start(...) for long-running processes.

Get A Process

List Processes

Write Process Stdin

Files

Read Text File

Write Text File

List Files

Watch A Directory

Create Upload URL

Create Download URL

Terminal

Create A Terminal

Use sandbox.terminal.create(...) or the alias sandbox.pty.create(...).

Get A Terminal

Snapshots

Create A Memory Snapshot

Sandbox guides:

Session Runtime Updates

Use session update helpers to change supported settings on an active browser without recreating it.

CAPTCHA Solving

solverType: "visual" enables the visual reCAPTCHA solver. Omit solverType to use the default automatic CAPTCHA solver configuration.

Manual CAPTCHA Evaluation

Supported captcha and captchaType values are turnstile, cloudflare-challenge, aliexpress, recaptcha, and amazon.

Integration Examples

Computer Actions

Programmatically control the browser with low-level actions. For the session-id parameter, you can also just pass in the detailed session object itself, and it is actually recommended to do so.

Click

Type Text

Press Keys

Uses the xdotool format for keys: https://github.com/sickcodes/xdotool-gui/blob/master/key_list.csv

Move Mouse

Drag

Scroll

Screenshot

Support