Handstage is distributed as scoped npm packages. Most projects need onlyDocumentation 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/core. Install it with your preferred package manager and you’re ready to start automating.
Install the package
Packages
Handstage ships as three packages. You only install the ones you need.| Package | Purpose | Install? |
|---|---|---|
@handstage/core | Browser automation — launch Chrome, navigate pages, interact with elements | Yes, for all projects |
@handstage/agent | AI tool definitions for passing browser control to an LLM | Only if using AI agents |
@handstage/dom | Internal DOM utilities used by @handstage/core | No — installed automatically as a dependency |
@handstage/agent:
TypeScript configuration
@handstage/core is published as an ES module ("type": "module"). Your project must be configured to use ES modules as well.
Set "type": "module" in your package.json:
tsconfig.json to target a module format compatible with Node.js ES modules:
If your project already uses CommonJS (
"type": "commonjs"), you’ll need to either migrate to ES modules or use a build tool like esbuild or tsx that handles the interop for you.Chrome requirement
Handstage controls Chrome over the Chrome DevTools Protocol and requires Chrome or Chromium to be installed on your system. When you callV3.connectLocal(), Handstage uses chrome-launcher to locate Chrome automatically. On most systems this works out of the box:
- macOS: Finds Chrome in
/Applications/Google Chrome.app - Linux: Looks for
google-chrome,chromium-browser, and similar executables on$PATH - Windows: Checks the default installation paths in
Program Files
Environment variables
Handstage reads one environment variable at startup:| Variable | Values | Effect |
|---|---|---|
HEADLESS | true | Launches Chrome in headless mode (no visible window). Any other value or absence runs Chrome with a visible UI. |
HEADLESS=true in your environment to run without a display, for example in CI:
Verify the installation
Create a file calledverify.ts and run it to confirm everything is working:
Next steps
Quickstart
Walk through a complete first automation script step by step.
Connecting to Chrome
Learn all the ways to launch or attach to a Chrome instance.