Practical overview
When it fits
Use Stagehand when an application needs a browser agent that can combine website interaction, persisted sessions and structured extraction in one developer workflow.
Who it is for
- TypeScript developers building browser agents
- Teams creating browser-automation applications
- Developers collecting structured data from websites
- Builders needing persisted signed-in browser sessions
Documented uses
- Navigate and interact with websites through natural-language actions
- Identify page elements and obtain selectors for browser operations
- Reuse cookies from a local browser profile across runs
- Extract website data into a defined schema
Requirements & limits
The repository is publicly available under the MIT license. The documented example requires an OpenAI API key and application credentials supplied through environment variables.
- TypeScript is the documented primary language.
- The example uses a local browser and persists cookies in ./browser-data.
- OpenAI is the demonstrated model backend.
- The extraction example uses Zod for schema validation.
- The repository context lists Playwright, CDP and headless Chrome alongside browser-agent and data-extraction use cases.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up a persistent browser-agent session
Launch a local browser, configure Stagehand with OpenAI and preserve cookies for later runs.
Before you start
- A TypeScript project using the Stagehand SDK.
- A local browser launch with a user-data directory.
- An OpenAI API key available as OPENAI_API_KEY.
Steps
Launch the local browser with userDataDir set to ./browser-data.
Create a Stagehand instance with an OpenAI model name and OPENAI_API_KEY.
Use the browser context and Stagehand methods for the documented site interaction.
Close the Stagehand instance and browser after the workflow.
Expected outcome
Later browser-agent runs can start with the session data stored in ./browser-data.
Guide limitations
- The example demonstrates an OpenAI model configuration but does not establish support for every OpenAI model.
- The example documents session persistence and interaction, not a compatibility guarantee for every website.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 2 October 2026
- Original website title
- browserbase/stagehand · Official homepage title · retained in its source language

