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
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add version tabs to the Stagehand integration guide's "existing project" section (v4 and v3 flows) and wrap the file I/O download example in a CodeGroup with v4 and v3 variants. CLI template stays v4-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>


Updates the Stagehand documentation for Stagehand SDK v4 while keeping the v3 examples available. The prior guide was v3-only and no longer matched the shipped
stagehandCLI template (migrated to v4).Changes
integrations/stagehand.mdxkernel create --template stagehand, setMODEL+MODEL_API_KEY, deploy, invoke.<Tabs>block with a Stagehand v4 tab and a Stagehand v3 tab, each showing the full setup for that version:localBrowser.connect({ cdpUrl })(noextensionId) +Stagehand.create({ browser }), asyncactivePage(),{ data }fromextract, nested cleanup.new Stagehand({ localBrowserLaunchOptions })+init(),context.pages()[0], cleanup).browsers/file-io.mdx— the Stagehand download example is now a<CodeGroup>with Stagehand v4 and Stagehand v3 variants. v4 reads from the default download directory/home/kernel/Downloadsand skips in-progress.crdownloadfiles; v3 keeps thelocalBrowserLaunchOptions(downloadsPath+acceptDownloads) approach.reference/cli/create.mdx— template description updated from "v3 SDK integration" to "v4".Testing
The v4 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 MB). The.crdownloadskip was added after an initial run read a partial file.The v3 snippets are the previously-shipped v3 examples, restored unchanged.
Notes
🤖 Generated with Claude Code