---
name: bijection-stagehand
description: "Evaluate and integrate the Stagehand component with Bijection."
---

# Stagehand

Browser automation

- Package: @bijectionhq/stagehand
- Category: Web & Search
- Status: Reference
- License: MIT
- Bijection source (repository access required): https://github.com/bijectionhq/stagehand/tree/ab96c95ecf03ebf14d089ec794b109e8689f5df4
- Upstream: https://github.com/browserbase/convex-stagehand/tree/cd2818b51e6099a24bcec49fa45b1c0a5a2e2a04
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/stagehand

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/stagehand.git
cd stagehand
git checkout ab96c95ecf03ebf14d089ec794b109e8689f5df4
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @browserbasehq/convex-stagehand. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


> Agents: read this skill fully before writing code that uses Browserbase Stagehand. Follow the installation and configuration steps exactly.

# Browserbase Stagehand

## Instructions

convex-stagehand brings AI-powered browser automation to Convex actions using natural language instructions. Extract structured data from web pages, perform complex user interactions, and automate multi-step workflows without writing Playwright code. The component manages browser sessions via Browserbase's cloud infrastructure and uses LLM models to interpret page content and execute tasks autonomously.

### Installation

```bash
npm install @browserbasehq/convex-stagehand
```

Current npm version: `@browserbasehq/convex-stagehand@0.1.1`

## Use cases

- **Web scraping with dynamic content** - Extract structured data from JavaScript-heavy sites that require user interactions like clicking load-more buttons or navigating through paginated results
- **Automated form filling and submissions** - Complete multi-step registration flows, checkout processes, or data entry tasks by describing the workflow in plain English
- **Competitive intelligence gathering** - Monitor competitor pricing, product catalogs, or feature updates by automating regular data collection from their websites
- **Testing user journeys** - Validate critical user flows like signup, purchase, or onboarding by having an AI agent complete the entire process
- **Lead generation and research** - Automatically gather contact information, company details, or market research data from business directories and professional networks

## How it works

The component wraps Stagehand's REST API and integrates with Convex's action system to provide browser automation capabilities. You configure it with Browserbase credentials and an LLM API key, then call methods like `extract()`, `act()`, or `agent()` from your Convex actions. Each method accepts natural language instructions and optional Zod schemas for type-safe data extraction.

For simple tasks, methods like `extract()` and `act()` automatically manage browser sessions - creating, using, and destroying them within a single operation. For complex workflows requiring state persistence, you can manually control sessions using `startSession()` and `endSession()`, allowing you to maintain login status, cookies, and page state across multiple Convex action calls.

The `agent()` method provides autonomous automation where the AI plans and executes multi-step tasks. It analyzes web pages, decides what actions to take, and iterates until the instruction is complete. All operations return structured data that matches your Zod schemas, making the extracted information immediately usable in your Convex database mutations and business logic.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Browserbase Stagehand is not needed

## Resources

- [npm package](https://www.npmjs.com/package/%40browserbasehq%2Fconvex-stagehand)
- [GitHub repository](https://github.com/browserbase/convex-stagehand)
- [Convex Components Directory](https://www.convex.dev/components/stagehand)
- [Convex documentation](https://docs.convex.dev)