Update Stagehand docs to v4 - #503
Conversation
Rewrite the Stagehand integration guide for v4: a CLI-template quick start and a step-by-step path for adding Kernel to an existing v4 project. v4 runs as a Chrome extension, so the guide covers loading it onto the running Kernel browser and connecting with localBrowser.connect (no extensionId). Also update the file I/O download example and the CLI template reference for v4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Risk assessment: Very Low
Decision: Approve.
This PR touches only three Mintlify documentation pages (integrations/stagehand.mdx, browsers/file-io.mdx, reference/cli/create.mdx). The diff rewrites Stagehand examples from the v3 constructor/init() API to the v4 localBrowser.connect + Stagehand.create flow, updates the file I/O download snippet (default /home/kernel/Downloads, skip .crdownload), and changes one CLI template label from v3 to v4.
Why Very Low
- Documentation-only MDX. No application code, CI, config (
docs.json), redirects, or infrastructure. - No auth, billing, permissions, or production logic changes.
- No CODEOWNERS file and branch rules do not require code-owner review.
- Blast radius is limited to published docs copy and example snippets.
These files are product docs, not model-instruction / prompt files, so the prompt-change override does not apply.
Sent by Cursor Automation: Assign PR reviewers


Updates the Stagehand documentation for Stagehand SDK v4. The current guide is entirely v3 and no longer matches the shipped
stagehandCLI template (which was migrated to v4).Changes
integrations/stagehand.mdx— rewritten for v4, with two paths:kernel create --template stagehand, setMODEL+MODEL_API_KEY, deploy, invoke.localBrowser.connect({ cdpUrl })(noextensionId) +Stagehand.create({ browser }), asyncactivePage(),{ data }fromextract, and nested cleanup.browsers/file-io.mdx— the Stagehand download example moved from v3 to v4: nolocalBrowserLaunchOptions(they don't apply toconnect), extension load step added, downloads read from the default directory/home/kernel/Downloads, andwaitForFilenow skips in-progress.crdownloadfiles.reference/cli/create.mdx— template description updated from "v3 SDK integration" to "v4".Testing
All snippets were run end-to-end against a real Kernel browser (Stagehand
4.0.0,@onkernel/sdk0.23.0,anthropic/claude-sonnet-4-5):{"teamSize":"6"}..crdownloadtemp file, and reads the completed file from/home/kernel/Downloads(6.1 MBsandstorm.mp3). The.crdownloadskip was added after an initial run read a partial file.Note
Kept the Stagehand examples TypeScript-only, matching the prior version of these pages (Stagehand is TS-first). AGENTS.md prefers a Python counterpart for code examples — happy to add one if there's a Python Stagehand v4 path worth documenting.
🤖 Generated with Claude Code
Note
Low Risk
Documentation-only updates to MDX; no runtime or API behavior changes.
Overview
Realigns Stagehand documentation with SDK v4 so it matches the shipped
stagehandCLI template (previously documented as v3).The Stagehand integration guide is restructured around a CLI template quick start (
kernel create --template stagehand,MODEL/MODEL_API_KEY, deploy/invoke) and a migrate an existing v4 project path: upload the Stagehand Chrome extension onto the Kernel browser viauploadZip, connect withlocalBrowser.connect({ cdpUrl })andStagehand.create({ browser, model }), use asyncactivePage()and{ data }fromextract, plus nested cleanup because v4 does not tear down externally connected browsers. Notes cover the extension model, zod v4, and updated migration links.The File I/O Stagehand download example drops v3
localBrowserLaunchOptions/init(), adds the same extension-load + connect flow, reads from the default/home/kernel/Downloads, and skips.crdownloadfiles while polling.reference/cli/create.mdxlabels thestagehandtemplate as v4.Reviewed by Cursor Bugbot for commit 55e37cc. Bugbot is set up for automated code reviews on this repo. Configure here.