Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/l-xiaoshen/handstage/llms.txt

Use this file to discover all available pages before exploring further.

Handstage is a TypeScript browser automation library built directly on Chrome’s DevTools Protocol (CDP). It gives you precise control over Chrome — launching browsers, navigating pages, interacting with elements, capturing screenshots, and reading accessibility trees — with a clean, typed API and no hidden abstractions.

Quickstart

Launch Chrome and automate your first page in under 5 minutes.

Installation

Install @handstage/core and set up your TypeScript project.

Core Concepts

Understand browsers, contexts, pages, and locators.

API Reference

Full reference for the V3 class and all public APIs.

What you can do with Handstage

Browser control

Launch or attach to local Chrome, create isolated browser contexts, and manage multiple tabs.

Element interaction

Click, fill, type, hover, and upload files using CSS or XPath selectors with shadow DOM support.

Accessibility snapshots

Capture structured accessibility trees for AI agent vision and reliable element targeting.

AI agent integration

Use @handstage/agent to give any LLM a fully-typed browser tool set via the Vercel AI SDK.

Screenshots

Take full-page or element-level screenshots with animation control and mask support.

Cookie & header management

Read, set, and clear cookies. Inject custom HTTP headers across all requests.

Get started in 3 steps

1

Install the package

Add @handstage/core to your project:
npm install @handstage/core
2

Launch Chrome and open a page

import { V3 } from "@handstage/core"

const browser = await V3.connectLocal()
const page = await browser.context.newPage("https://example.com")
console.log(await page.title())
await browser.close()
3

Interact with elements

await page.locator("input[name='q']").fill("handstage")
await page.locator("button[type='submit']").click()
await page.waitForLoadState("networkidle")
Handstage requires Chrome or Chromium to be installed. On most systems, V3.connectLocal() finds Chrome automatically. See Connecting to Chrome for advanced configuration.

Build docs developers (and LLMs) love