Skip to content

Update Stagehand docs to v4 - #503

Merged
dprevoznik merged 4 commits into
mainfrom
hypeship/stagehand-v4-docs
Aug 17, 2026
Merged

Update Stagehand docs to v4#503
dprevoznik merged 4 commits 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 while keeping the v3 examples available. The prior guide was v3-only and no longer matched the shipped stagehand CLI template (migrated to v4).

Changes

integrations/stagehand.mdx

  • Quick start with the CLI template (v4) — kernel create --template stagehand, set MODEL + MODEL_API_KEY, deploy, invoke.
  • Adding Kernel to an existing Stagehand project — a <Tabs> block with a Stagehand v4 tab and a Stagehand v3 tab, each showing the full setup for that version:
    • v4: install the SDK, load the Stagehand extension onto the running browser, localBrowser.connect({ cdpUrl }) (no extensionId) + Stagehand.create({ browser }), async activePage(), { data } from extract, nested cleanup.
    • v3: the original flow (new Stagehand({ localBrowserLaunchOptions }) + init(), context.pages()[0], cleanup).
  • Version note explains the extension model and points at the migration guide.

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/Downloads and skips in-progress .crdownload files; v3 keeps the localBrowserLaunchOptions (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/sdk 0.23.0, anthropic/claude-sonnet-4-5):

  • The "existing v4 project" flow returns {"teamSize":"6"}.
  • The v4 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). The .crdownload skip was added after an initial run read a partial file.

The v3 snippets are the previously-shipped v3 examples, restored unchanged.

Notes

  • The CLI template is v4-only; this PR does not change the template, only the docs.
  • Stagehand examples are TypeScript-only, matching the prior version of these pages (Stagehand is TS-first).

🤖 Generated with Claude Code

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

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>
@dprevoznik
dprevoznik merged commit 37a1283 into main Aug 17, 2026
2 checks passed
@dprevoznik
dprevoznik deleted the hypeship/stagehand-v4-docs branch August 17, 2026 16:14
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.

2 participants