Overview
Stagehand is an AI Browser Automation Framework developed by Browserbase. Laminar provides native integration with Stagehand, allowing you to trace your Stagehand code with just a few lines of code. Laminar observability captures:- Full recording of a browser window while the code is running.
- Execution steps, such as,
act,extract,observeandagentcalls. - Full LLM calls, including the prompts and responses.
- LLM cost of the execution steps.
- Latency of the execution steps and LLM calls.
Quickstart
Below is an example of a simple Stagehand script. Highlighted lines are the ones that are required to trace Stagehand with Laminar.- Stagehand v3
- Stagehand v2
Step-by-step guide
Start with Stagehand Browser quickstart
Initialize Laminar
First, we need to initialize Laminar at the start of your application and pass the Stagehand module to
instrumentModules.Example of a Stagehand trace
You can see entire session recording of a browser window while the code was running, along with execution steps, such asact and extract. You can also see LLM cost of the entire execution and of each execution step. For LLM spans you can see the prompt, the response and the model name.

