<h1 align="center">
<a href="https://prompts.chat">
- Removes internal Playwright dependency
Sign in to like and favorite skills
act, extract, & observe callspagelocator (built in closed mode shadow root traversal, with xpaths & css selectors)frameLocatordeepLocator (crosses iframes & shadow roots)Check the migration guide for more information
8244ab2 Thanks @sameelarif! - Added support for stagehand.agent to interact with MCP servers as well as custom tools to be passed in. For more information, reference the MCP integrations documentation#959
Thanks @filip-michalsky! - add webvoyager evals09b5e1e
#1049
Thanks @miguelg719! - Support local MCP server connectionse3734b9
#1025
Thanks @tkattkat! - add support for custom baseUrl within openai providerbe85b19
#1040
Thanks @miguelg719! - Allow OpenAI CUA to take in an optional baseURL88d1565
#1046
Thanks @tkattkat! - Add support for gpt-5 in operator agentab5d6ed
9e8c173 Thanks @miguelg719! - Fix disabling api validation whenever a customLLM client is provided#951
Thanks @miguelg719! - Patch GPT-5 new api formatf45afdc
#954
Thanks @seanmcguire12! - add support for shadow DOMs (open & closed mode) when experimental: true261bba4
#944
Thanks @seanmcguire12! - Bump zod version compatibility and add pathing spec8de7bd8
#919
Thanks @seanmcguire12! - enable scrolling inside of iframes3d80421
#963
Thanks @tkattkat! - Properly handle images in evaluator + clean up response parsing logic0ead63d
#961
Thanks @tkattkat! - Add more evals for stagehand agent8422828
#946
Thanks @seanmcguire12! - fix: unable to act on/get content from some same process iframesb769206
#962
Thanks @seanmcguire12! - handle namespaced elements in xpath build step72d2683
#865
Thanks @seanmcguire12! - improve type safety for trimTrailingTextNode6b4e6e3
#897
Thanks @miguelg719! - Fix selfHeal to remember intially received argumentse77d018
#920
Thanks @seanmcguire12! - fix: tab handling on APIc20adb9
#882
Thanks @seanmcguire12! - remove elements that don't have xpaths from observe responseb86df93
#905
Thanks @tkattkat! - Delete old images from anthropic cua client023c2c2
#925
Thanks @miguelg719! - Remove _refreshPageFromApi()8c28647
#887
Thanks @seanmcguire12! - fix: allow xpaths with prepended 'xpath=' for targeted extract87e09c6
#864
Thanks @miguelg719! - Temporarily patch custom clients serialization error on apia611115
#881
Thanks @miguelg719! - Pass sdk version number to API for debugging69913fe
#913
Thanks @seanmcguire12! - move iframe out of 'experimental'b1b83a1
#891
Thanks @seanmcguire12! - fix: nested iframe xpath bugbe8497c
#883
Thanks @seanmcguire12! - add timeout for JS click98704c9
#907
Thanks @seanmcguire12! - store mapping of CDP frame ID -> page04978bd
#856
Thanks @seanmcguire12! - set download behaviour by default8a43c5a
#857
Thanks @miguelg719! - return "not-supported" for elements inside the shadow-dom890ffcc
#844
Thanks @seanmcguire12! - don't automatically close tabs64c1072
#860
Thanks @miguelg719! - Set default schema on extract options with no schemab077d3f
#842
Thanks @seanmcguire12! - improved handling for OS level dropdowns8bcb5d7
#846
Thanks @miguelg719! - Filter attaching to target worker / shared_worker7bf10c5
6a18c1e Thanks @seanmcguire12! - try playwright click and fall back to JS click event#826
Thanks @seanmcguire12! - fix issue where we are unable to take actions on text nodes124e0d3
#818
Thanks @miguelg719! - Added CUA support for Claude 4 models1660751
#821
Thanks @seanmcguire12! - use playwright instead of playwright testcadac9d
#832
Thanks @miguelg719! - Fix _refreshPageFromAPI to use parametrized apiKey759da55
#810
Thanks @miguelg719! - Update logosa175a51
#822
Thanks @miguelg719! - Add model with date tag for OpenAI CUA8527a80
#833
Thanks @seanmcguire12! - adjust stagehandLogger.warn() level to be 1 instead of 055fca2f
#796
Thanks @miguelg719! - Added a experimental flag to enable the newest and most experimental features12a99b3
#807
Thanks @seanmcguire12! - include version number in StagehandDefaultError message2451797
#803
Thanks @miguelg719! - Enable session affinity for cache optimization1d631a5
#804
Thanks @seanmcguire12! - update operatorResponseSchema based on new openai spec9c398bb
#786
Thanks @miguelg719! - Handle reroute to account for rolloutc19ad7f
6ef6073 Thanks @seanmcguire12! - deprecate useTextExtract and remove functionality#741
Thanks @seanmcguire12! - use safeparse for zod validation5680d25
#783
Thanks @miguelg719! - Fix the readme logo link4de92a8
#721
Thanks @miguelg719! - Fix stagehand.close() functionality to include calling browser.close()be8652e
#724
Thanks @seanmcguire12! - rm refine step in extract6b413b7
#712
Thanks @seanmcguire12! - deprecated 7eafbd9
onlyVisible param and remove its functionality
#725
Thanks @seanmcguire12! - dont overwrite .describe() when user defines a zod schema with z.string().url().describe()1b50aa6
#717
Thanks @seanmcguire12! - don't publish uncompiled ts to npmf2b7f1f
#719
Thanks @seanmcguire12! - fix c8d672f
Invalid schema for response_format error when extracting links
#722
Thanks @seanmcguire12! - replace NBSP with regular space & remove special characters from dom+a11y treebebf204
#714
Thanks @miguelg719! - Fix the native AI SDK client implementation to optionally take in an API key37d6810
#655
Thanks @seanmcguire12! - extract links8814af9
#675
Thanks @tkattkat! - Added Gemini 2.5 Flash to Google supported models35c55eb
#668
Thanks @miguelg719! - Added a new class - Stagehand Evaluator - that wraps around a Stagehand object to determine whether a task is successful or not. Currently used for agent evals5c6d2cf
#706
Thanks @seanmcguire12! - remove unused fillInVariables fn18ac6fb
#692
Thanks @miguelg719! - Updated the list of OpenAI models (4.1, o3...)6b95248
#688
Thanks @seanmcguire12! - wrap page.evaluate to make sure we have injected browser side scripts before calling them7d81b3c
#664
Thanks @miguelg719! - remove unnecessary logb5ca00a
#683
Thanks @seanmcguire12! - use javsacript click instead of playwright8f0f97b
#705
Thanks @miguelg719! - Fixed removing a hanging observation map that is no longer used346ef5d
#698
Thanks @sameelarif! - Fixing LLM client support to natively integrate with AI SDKc145bc1
#687
Thanks @miguelg719! - Fixed the schema input for Gemini's response modeledd6d3f
#678
Thanks @seanmcguire12! - allow form filling when form is not top-most element5ec43d8
#694
Thanks @seanmcguire12! - add telemetry for cua agents to stagehand.metricsb8cc164
#699
Thanks @seanmcguire12! - rm deprecated primitives from stagehand objectd9f4243
#710
Thanks @seanmcguire12! - support targeted extract for domExtract9f4ab76
#677
Thanks @miguelg719! - Fixes a redundant unnecessary logbc5a731
f9a435e Thanks @miguelg719! - Added native support for Google Generative models (Gemini)#647
Thanks @seanmcguire12! - collapse redundant text nodes into parent elementsca5467d
#636
Thanks @seanmcguire12! - fix token act metrics and inference logging being misplaced as observe metrics and inference logging9037430
#648
Thanks @seanmcguire12! - add mapping of node id -> url169e7ea
#654
Thanks @seanmcguire12! - fix repeated up & down scrolling bug for clicks inside 57a9853
act
#624
Thanks @seanmcguire12! - export stagehand error classes so they can be referenced from @distcf167a4
#640
Thanks @yash1744! - Added support for stagehand agents to automatically redirect to https://google.com when the page URL is empty or set to about:blank, preventing empty screenshots and saving tokens.178f5f0
#633
Thanks @miguelg719! - Fix the getBrowser logic for redundant api calls and throw informed errors86724f6
#656
Thanks @seanmcguire12! - parse out % signs from variables in actc630373
#637
Thanks @kamath! - Fix: forward along the stack trace in StagehandDefaultError944bbbf
#591
Thanks @miguelg719! - Announcing Stagehand 2.0! 🎉e234a0f
We're thrilled to announce the release of Stagehand 2.0, bringing significant improvements to make browser automation more powerful, faster, and easier to use than ever before.
stagehand.agent: A powerful new way to integrate SOTA Computer use models or Browserbase's Open Operator into Stagehand with one line of code! Perfect for multi-step workflows and complex interactions. Learn moreact and extract: Major performance improvements to make your automations run significantly faster.We're excited to see what you build with Stagehand 2.0! For questions or support, join our Slack community.
For more details, check out our documentation.
#588
Thanks @sameelarif! - Added support for offloading agent tasks to the API.ba9efc5
#600
Thanks @sameelarif! - Added a 11e015d
stagehand.history array which stores an array of act, extract, observe, and goto calls made. Since this history array is stored on the StagehandPage level, it will capture methods even if indirectly called by an agent.
#601
Thanks @seanmcguire12! - add custom error classes1d22604
#599
Thanks @miguelg719! - cleaner logging with pino75d8fb3
#609
Thanks @kamath! - Removed deprecated fields and methods from Stagehand constructor and added cdpUrl to localBrowserLaunchOptions for custom CDP URLs support.c92295d
#571
Thanks @miguelg719! - You can now use Computer Using Agents (CUA) natively in Stagehand for both Anthropic and OpenAI models! This unlocks a brand new frontier of applications for Stagehand users 🤘73d6736
#619
Thanks @sameelarif! - add disablePino flag to stagehand constructor params7b0b996
#620
Thanks @kamath! - You can now pass in an OpenAI instance as an 566e587
llmClient to the Stagehand constructor! This allows you to use Stagehand with any OpenAI-compatible model, like Ollama, Gemini, etc., as well as OpenAI wrappers like Braintrust.
#586
Thanks @sameelarif! - Added native Stagehand agentic loop functionality. This allows you to build agentic workflows with a single prompt without using a computer-use model. To try it out, create a c57dc19
stagehand.agent without passing in a provider.
#580
Thanks @seanmcguire12! - refactor _performPlaywrightMethod179e17c
#608
Thanks @seanmcguire12! - added support for "scrolling to next/previous chunk"71ee10d
#594
Thanks @seanmcguire12! - pass observeHandler into actHandlere483484
#569
Thanks @seanmcguire12! - you can now call stagehand.metrics to get token usage metrics. you can also set logInferenceToFile in stagehand config to log the entire call/response history from stagehand & the LLM.17e8b40
#617
Thanks @seanmcguire12! - use a11y tree for default extractaffa564
#589
Thanks @miguelg719! - Added CDP support for screenshots, find more about the benefits here: https://docs.browserbase.com/features/screenshots#why-use-cdp-for-screenshots%3F0c4b1e7
#584
Thanks @miguelg719! - Fix to remove unnecessary healtcheck ping on sdkc7c1a80
#616
Thanks @miguelg719! - Fixed new opened tab handling for CUA models2a27e1c
#582
Thanks @seanmcguire12! - support api usage for extract with no argsdfd24e6
#563
Thanks @seanmcguire12! - support scrolling in 98166d7
act
#598
Thanks @miguelg719! - Fix the open operator handler to work with anthropic53889d4
#605
Thanks @sameelarif! - Added support for resuming a Stagehand session created on the API.b8beaec
#612
Thanks @seanmcguire12! - remove all logic related to dom based actcd36068
#577
Thanks @seanmcguire12! - remove debugDom4fdbf63
#603
Thanks @seanmcguire12! - rm unused handlePossiblePageNavigation2a14a60
#614
Thanks @kamath! - override whatwg-url to avoid punycode warninga59eaef
#573
Thanks @seanmcguire12! - return act result in actFromObservec24f3c9
#518
Thanks @sameelarif! - 516725f
act() can now use observe() under the hood, resulting in significant performance improvements. To opt-in to this change, set slowDomBasedAct: false in ActOptions.
#483
Thanks @seanmcguire12! - When using 8c9445f
textExtract, you can now do targetted extraction by passing an xpath string into extract via the selector parameter. This limits the dom processing step to a target element, reducing tokens and increasing speed. For example:
const weatherData = await stagehand.page.extract({ instruction: "extract the weather data for Sun, Feb 23 at 11PM", schema: z.object({ temperature: z.string(), weather_description: z.string(), wind: z.string(), humidity: z.string(), barometer: z.string(), visibility: z.string(), }), modelName, useTextExtract, selector: xpath, // xpath of the element to extract from });
#556
Thanks @kamath! - You can now set a timeout for dom-based stagehand act! Do this in 499a72d
act with timeoutMs as a parameter, or set a global param to actTimeoutMs in Stagehand config.
#544
Thanks @seanmcguire12! - you can now deterministically get the full text representation of a webpage by calling 55c9673
extract() (with no arguments)
#538
Thanks @sameelarif! - Added d898d5b
gpt-4.5-preview and claude-3-7-sonnet-latest as supported models.
#523
Thanks @kwt00! You can now natively run Cerebras LLMs! 44cf7cc
cerebras-llama-3.3-70b and cerebras-llama-3.1-8b are now supported models as long as CEREBRAS_API_KEY is set in your environment.
#542
Thanks @sankalpgunturi! You can now natively run Groq LLMs! cf7fe66
groq-llama-3.3-70b-versatile and groq-llama-3.3-70b-specdec are now supported models as long as GROQ_API_KEY is set in your environment.
#506
Thanks @miguelg719! - fixing 5s timeout on actHandlere521645
#535
Thanks @miguelg719! - Adding backwards compatibility to new act->observe pipeline by accepting actOptions3782054
#508
Thanks @miguelg719! - Fixed stagehand to support multiple pages with an enhanced context270f666
#559
Thanks @seanmcguire12! - fix: continuously adjusting chunk size inside 18533ad
act
#554
Thanks @seanmcguire12! - fix targetted extract issue with scrollintoview and not chunking correctly5f1868b
#555
Thanks @seanmcguire12! - fix issue where processAllOfDom doesnt scroll to end of page when there is dynamic contentfc5e8b6
#552
Thanks @seanmcguire12! - accept xpaths with 'xpath=' prepended to the front in addition to xpaths withouta25a4cb
#534
Thanks @seanmcguire12! - call this.end() if the process existsf0c162a
#528
Thanks @seanmcguire12! - handle attempt to close session that has already been closed when using the apic820bfc
#520
Thanks @miguelg719! - Performing act from a 'not-supported' ObserveResult will now throw an informed errorf49eebd
a7d345e Thanks @miguelg719! - Bun runs will now throw a more informed error#486
Thanks @sameelarif! - [Unreleased] Parameterized offloading Stagehand method calls to the Stagehand API. In the future, this will allow for better observability and debugging experience.33f2b3f
#494
Thanks @pkiv! - Added LocalBrowserLaunchOptions to provide comprehensive configuration options for local browser instances. Deprecated the top-level headless option in favor of using localBrowserLaunchOptions.headless9ba4b0b
#500
Thanks @miguelg719! - Including Iframes in ObserveResults. This appends any iframe(s) found in the page to the end of observe results on any observe call.a683fab
#504
Thanks @sameelarif! - Enabled support for Browserbase captcha solving after page navigations. This can be enabled with the new constructor parameter: 577662e
waitForCaptchaSolves.
#496
Thanks @sameelarif! - Fixed browserbaseSessionCreateParams not being passed in to the API initialization payload.28ca9fb
#459
Thanks @seanmcguire12! - create a11y + dom hybrid input for observe62a29ee
#463
Thanks @seanmcguire12! - include 'Scrollable' annotations in a11y-dom hybride40bf6f
#480
Thanks @miguelg719! - Adding a fallback try on actFromObserveResult to use the description from observe and call regular act.4c07c44
#487
Thanks @seanmcguire12! - update refine extraction prompt to ensure correct schema is used2c855cf
#426
Thanks @miguelg719! - Observe got a major upgrade. Now it will return a suggested playwright method with any necessary arguments for the generated candidate elements. It also includes a major speedup when using a11y tree processing for context.bbbcee7
#452
Thanks @kamath! - add o3-mini to availablemodel16837ec
#441
Thanks @seanmcguire12! - allow act to accept observe output1032d7d
#458
Thanks @miguelg719! - Updated getAccessibilityTree() to make sure it doesn't skip useful nodes. Improved getXPathByResolvedObjectId() to account for text nodes and not skip generationda2e5d1
#448
Thanks @seanmcguire12! - improve handling of radio button clicksb216072
#445
Thanks @miguelg719! - Adding back useAccessibilityTree param to observe with a deprecation warning/error indicating to use onlyVisible instead5bc514f
5efeb5a Thanks @seanmcguire12! - temporarily remove visiona2878d0 Thanks @miguelg719! - Fixing a build type error for async functions being called inside evaulate for observeHandler.#412
Thanks @miguelg719! - Includes a new format to get website context using accessibility (a11y) trees. The new context is provided optionally with the flag useAccessibilityTree for observe tasks.4aa4813
#417
Thanks @sameelarif! - Simplify Stagehand method calls by allowing a simple string input instead of an options object.1f2b2c5
#405
Thanks @seanmcguire12! - in ProcessAllOfDom, scroll on large scrollable elements instead of just the root DOM0df1e23
#373
Thanks @sameelarif! - Allow the input of custom instructions into the constructor so that users can guide, or provide guardrails to, the LLM in making decisions.ff00965
#362
Thanks @seanmcguire12! - reduce collisions and improve accuracy of textExtract9c20de3
#413
Thanks @seanmcguire12! - remove topMostElement check when verifying visibility of text nodes737b4b2
#374
Thanks @sameelarif! - Pass in a Stagehand Page object into the 207244e
on("popup") listener to allow for multi-page handling.
#367
Thanks @kamath! - Logger in LLMClient is inherited by default from Stagehand. Named rather than positional arguments are used in implemented LLMClients.75c0e20
#385
Thanks @sameelarif! - Moved the LLMClient logger paremeter to the createChatCompletion method options.5899ec2
#364
Thanks @kamath! - exposed llmClient in stagehand constructor08907eb
#383
Thanks @sameelarif! - Unified LLM input/output types for reduced dependence on OpenAI typesa77efcc
#353
Thanks @kamath! - Throw custom error if context is referenced without initialization, remove act/extract handler from index5c6f14b
#360
Thanks @kamath! - Remove stagehand nav entirely89841fc
#379
Thanks @seanmcguire12! - dont require LLM Client to use non-ai stagehand functionsb1c6579
#382
Thanks @sameelarif! - Added example implementation of the Vercel AI SDK as an LLMClienta41271b
#344
Thanks @kamath! - Remove duplicate logging and expose Page/BrowserContext typesc1cf345
#324
Thanks @kamath! - Move stagehand.act() -> stagehand.page.act() and deprecate stagehand.act()cd23fa3
#319
Thanks @kamath! - We now wrap playwright page/context within StagehandPage and StagehandContext objects. This helps us augment the Stagehand experience by being able to augment the underlying Playwrightbacbe60
#324
Thanks @kamath! - moves extract and act -> page and deprecates stagehand.extract and stagehand.observecd23fa3
#316
Thanks @kamath! - rename browserbaseResumeSessionID -> browserbaseSessionID902e633
#296
Thanks @kamath! - - Deprecate fields in f11da27
init in favor of constructor options
initFromPage in favor of browserbaseResumeSessionID in constructorbrowserBaseSessionCreateParams -> browserbaseSessionCreateParams#304
Thanks @seanmcguire12! - add textExtract: an optional, text based approach to the existing extract method. textExtract often performs better on long form extraction tasks. By default 0b72f75
extract uses the existing approach domExtract.
#298
Thanks @kamath! - Add sessionId to public params55f0cd2
#283
Thanks @sameelarif! - allowed customization of eval config via .envb902192
#299
Thanks @sameelarif! - log playwright actions for better debuggingfbe2300
#286
Thanks @kamath! - minor improvement in action + new eval case9605836
#279
Thanks @kamath! - Add support for o1-mini and o1-preview in OpenAIClientd6d7057
#282
Thanks @kamath! - Added eslint for stricter type checking. Streamlined most of the internal types throughout the cache, llm, and handlers. This should make it easier to add new LLMs down the line, maintain and update the existing code, and make it easier to add new features in the future. Types can be checked by running 5291797
npx eslint . from the project directory.
#270
Thanks @sameelarif! - add close link to readme6b10b3b
#288
Thanks @kamath! - add multi-region support for browserbase5afa0b9
#284
Thanks @kamath! - Build wasn't working, this addresses tsc failure.474217c
#236
Thanks @seanmcguire12! - reduce chunk size85483fe
0e8f34f Thanks @kamath! - Install wasn't working from NPM due to misconfigured build step. This attempts to fix that.598cae2 Thanks @sameelarif! - clean up contexts after use#225
Thanks @sameelarif! - Ensuring cross-platform compatibility with tmp directoriesa2366fe
#249
Thanks @seanmcguire12! - fix broken evals7d06d43
#227
Thanks @kamath! - Fix debugDom still showing chunks when set to false647eefd
#250
Thanks @seanmcguire12! - add ci specific evals5886620
#222
Thanks @sameelarif! - Streamline type definitions and fix existing typescript errors8dff026
#232
Thanks @kamath! - Minor changes to package.json and tsconfig, mainly around the build process. Also add more type defs and remove unused dependencies.b9f9949
87a6305 Thanks @kamath! - - Adds structured and more standardized JSON logging
enableCaching is false, preventing tmp/.cache from being created#179
Thanks @navidkpr! - Fixes:0031871
The last big change we pushed out, introduced a small regression. As a result, the gray outline showing the elements Stagehand is looking out is missing. This commit fixes that. We now process selectorMap properly now (using the updated type Record<number, string[]
Improved the action prompt:
Improved the structure Made it more straightforward Improved working for completed arg and prioritized precision over recall