Skip to content

Update Stagehand docs to v4 - #503

Open
dprevoznik wants to merge 1 commit into
mainfrom
hypeship/stagehand-v4-docs
Open

Update Stagehand docs to v4#503
dprevoznik wants to merge 1 commit into
mainfrom
hypeship/stagehand-v4-docs

Conversation

@dprevoznik

@dprevoznik dprevoznik commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Updates the Stagehand documentation for Stagehand SDK v4. The current guide is entirely v3 and no longer matches the shipped stagehand CLI template (which was migrated to v4).

Changes

integrations/stagehand.mdx — rewritten for v4, with two paths:

  • Quick start with the CLI templatekernel create --template stagehand, set MODEL + MODEL_API_KEY, deploy, invoke.
  • Add Kernel to an existing v4 project — step-by-step, copy-pasteable snippets: install the SDK (zod v4 note), load the Stagehand extension onto the running browser, localBrowser.connect({ cdpUrl }) (no extensionId) + Stagehand.create({ browser }), async activePage(), { data } from extract, and nested cleanup.
  • Version note now points at v4 and explains the extension model in one line; links the migration guide.

browsers/file-io.mdx — the Stagehand download example moved from v3 to v4: no localBrowserLaunchOptions (they don't apply to connect), extension load step added, downloads read from the default directory /home/kernel/Downloads, and waitForFile now skips in-progress .crdownload files.

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/sdk 0.23.0, anthropic/claude-sonnet-4-5):

  • The "existing v4 project" flow returns {"teamSize":"6"}.
  • The file I/O flow triggers a download, waits past the .crdownload temp file, and reads the completed file from /home/kernel/Downloads (6.1 MB sandstorm.mp3). The .crdownload skip 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 stagehand CLI 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 via uploadZip, connect with localBrowser.connect({ cdpUrl }) and Stagehand.create({ browser, model }), use async activePage() and { data } from extract, 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 .crdownload files while polling. reference/cli/create.mdx labels the stagehand template as v4.

Reviewed by Cursor Bugbot for commit 55e37cc. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
@mintlify

mintlify Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Kernel 🟢 Ready View Preview Aug 15, 2026, 5:39 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant