Skip to content

Migrate all Stagehand templates to V4 - #101

Merged
shrey150 merged 31 commits into
devfrom
agent/update-templates-stagehand-v4
Aug 21, 2026
Merged

shrey150 merged 31 commits into
devfrom
agent/update-templates-stagehand-v4

Conversation

@shrey150

@shrey150 shrey150 commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stagehand is the SDK for browser agents.

  • migrate every Stagehand template in this repository to the V4 lifecycle: 35 TypeScript, 32 Python, and 1 Go
  • use published @browserbasehq/stagehand@4.0.0 and stagehand==4.0.0 for the core SDKs
  • replace removed agent APIs with bring-your-own agent frameworks plus Stagehand code mode
  • adopt browserbase.launch() / localBrowser.launch(), Stagehand.create({ browser }), browser.context, V4 { data, metadata } envelopes, locator(), and explicit Stagehand-then-browser cleanup
  • keep shipped examples focused on demonstrating their task; validate correctness out of band instead of embedding test graders in template code
  • update the docs and template index for V4

Companion PR: browserbase/create-browser-app#40

Agent migration: 12 templates

Eight TypeScript templates use Vercel AI SDK ToolLoopAgent with Stagehand code mode's stateful code_execute tool:

  • typescript/agent-with-human-in-loop
  • typescript/browser-agent-demo
  • typescript/business-lookup
  • typescript/company-address-finder
  • typescript/dynamic-form-filling
  • typescript/gemini-3-flash
  • typescript/gemini-cua
  • typescript/microsoft-cua

Four Python templates use Deep Agents with the Stagehand integration's stateful browser tools:

  • python/business-lookup
  • python/cerebras-docs-checker
  • python/company-address-finder
  • python/gemini-cua

The Exa TypeScript and Python templates use a smaller direct Stagehand workflow: focused Exa discovery, one role, act / extract / observe, exact résumé upload mechanics, and a human-review result that never submits.

The Go template's removed autonomous Sessions.Execute step is now an explicit V4 Observe → Act → typed Extract workflow. Its live output is judged only by the external E2E harness.

Package state

  • TypeScript core: published @browserbasehq/stagehand@4.0.0
  • Python core: published stagehand==4.0.0
  • TypeScript code mode: exact reviewed source commit 54302fc5f13be5ad8e717d8e1388502de22be2ed until @browserbasehq/stagehand-codemode is published
  • Python Deep Agents integrations: business-lookup, company-address-finder, cerebras-docs-checker, and gemini-cua track stagehand/main. Their server dependency is published stagehand==4.0.0
  • Go V4 SDK: published github.com/browserbase/stagehand/packages/sdk-go/v4@v4.0.2

The code-mode Git dependency needs two temporary measures until publication: the pnpm subdirectory selector must be path:packages/integrations (no leading slash), and pnpm overrides must resolve the upstream monorepo's workspace: / catalog: dependencies. These are present in all eight code-mode manifests.

Fresh out-of-band 79-entrypoint E2E re-audit — 2026-08-21

Important

This section supersedes every earlier E2E table. Runtime claims use only executions performed in this audit; no historical result is counted.

Review assessment

Ready for human review. The current result set covers all 79 entrypoints: 72 runnable entries pass, zero runnable entries fail, and seven are explicitly blocked by unavailable login credentials or Cerebras quota.

Published head: c87e1c0, tree 08fc487690981454330a636b9d659760a55f090d.

Runtime Inventory Fresh PASS Fresh BLOCKED Fresh FAIL
TypeScript 41 38 3 0
Python 37 33 4 0
Go 1 1 0 0
Total 79 72 7 0

The harness installed and invoked every runnable entrypoint against real services and configured credentials. It ran the complete 79-entrypoint inventory, retained every result, then reran every entrypoint affected by a final min-cut fix. The final set is therefore complete for the published tree, while preserving the original full-run evidence and flake history.

Each entrypoint has a separate scratchpad validator outside the repository. Those validators inspect real output and, where applicable, deterministic external truth or artifacts: current Hacker News titles, ZIP/PDF/image contents, proxy IPs, response URLs, UI/SSE state, and form postconditions. None of this audit judging ships in template code.

Focused review follow-up — 2026-08-21

The inventory counts below remain one result per entrypoint. These additional repetitions specifically test the latest review-driven simplifications on the published head:

Focused flow Fresh result External evidence
Accessibility-reference caveat removal 36/36 PASS: 3 runs for each of 12 TypeScript/Python entrypoints Real HTTP(S) hrefs, Amazon /dp/ URLs, four-PDF ZIPs, image magic bytes, link reports, and Reducto PDF output
Python Browserbase + Reducto 3/3 PASS Typed async sessions.downloads.list returned a fresh ZIP containing a PDF; Reducto returned the complete iPhone sales object
Python Business Lookup with extra prompt clauses removed 3/3 PASS Every structured field matched the current official SF Open Data record
Cartesia conversational radio selection without a string heuristic 3/3 PASS across four radio answers per run, plus one full-flow PASS Deterministic outer inspection confirmed the selected labels; the complete nine-field synthetic submission reached the confirmation page
Go Hacker News on published sdk-go/v4@v4.0.2 PASS go test ./... and the real observe → act → two typed extracts completed
Gemini CUA integration from stagehand@main PASS Current main built successfully and the real two-source eclipse workflow completed
TypeScript Model Router defaults PASS Smart Fetch forced a real browser fallback and routed extract; Website Link Tester completed 3 consecutive one-link runs after one initial invalid-URL structured-output miss

All 12 “never return an accessibility-tree reference” prompt/schema caveats were removed only after the corresponding entrypoint reached 3/3 with the caveat absent. TypeScript and Python were evaluated independently; no result was inferred across SDKs.

Fresh TypeScript passes (38)

agent-with-human-in-loop, amazon-global-price-comparison, amazon-product-scraping, basic-caching, basic-recaptcha, browser-agent-demo, browserbase-reducto, business-lookup, company-address-finder, company-value-prop-generator, council-events, download-financial-statements, dynamic-form-filling, exa-browserbase, extend-browserbase, form-filling, gemini-3-flash, gemini-cua, getting-started-with-browserbase, gift-finder, google-trends, image-url-download, job-application, license-verification, mfa-handling, microsoft-cua, nurse-verification, playwright-mfa-handling, playwright/basic-recaptcha, playwright/quickstart-playwright, polymarket-research, proxies, proxies-weather, puppeteer/quickstart-puppeteer, sec-filing-research, selenium/quickstart-selenium, smart-fetch-scraper, website-link-tester.

Fresh Python passes (33)

amazon-global-price-comparison, amazon-product-scraping, basic-caching, basic-recaptcha, browserbase-reducto, business-lookup, cartesia-form-filling, company-address-finder, company-value-prop-generator, council-events, download-financial-statements, exa-browserbase, extend-browserbase, form-filling, gemini-cua, getting-started-with-browserbase, gift-finder, google-trends, image-url-download, job-application, license-verification, mfa-handling, nurse-verification, playwright-mfa-handling, playwright/basic-recaptcha, playwright/quickstart-playwright, polymarket-research, proxies, proxies-weather, sec-filing-research, selenium/quickstart-selenium, smart-fetch-scraper, website-link-tester.

Go hackernews: PASS.

Fresh blockers

Entrypoints Count Fresh evidence / unblock
TypeScript + Python context and pickleball 4 SF_REC_PARK_EMAIL and SF_REC_PARK_PASSWORD are not configured as Coder User Secrets. Tests use BOOK_COURT=false; no reservation would be made.
TypeScript + Python manual-mfa-with-contexts 2 GITHUB_USERNAME and GITHUB_PASSWORD are not configured as Coder User Secrets.
Python cerebras-docs-checker 1 Crawl/repository discovery reached the model call, then the configured Cerebras credential returned HTTP 402/payment required. Billing/quota must be restored.

Do not paste credentials into the PR. Configure them through managed Coder User Secrets if fresh coverage of those paths is required.

Approved policy audit

The published tree is 79/79 policy-aligned under the full review contract:

  1. V4 lifecycle, envelopes, cleanup, and idiomatic first-party SDK dependencies are used; handwritten Browserbase REST calls were removed.
  2. Explicit Stagehand workflows retain act / extract / observe as their primary semantics. No primitive was swapped for deterministic page actions merely to pass E2E.
  3. Direct page/locator methods are classified per entrypoint and limited to native-framework examples, agent/code-mode autonomy, exact file/download mechanics, intrinsic product checks, or a semantic-first correctness fallback.
  4. Code-mode and Deep Agent prompts are not forced toward semantic Stagehand primitives; deterministic code is intentional in those architectures.
  5. Shipped examples demonstrate their advertised workflow. Known-answer judging, live-page comparison, and E2E assertions remain in the external scratchpad harness.
  6. In-template validation remains only where evaluation is itself the product, including caching, CAPTCHA/authentication, proxy/geolocation, link testing, docs checking, ranking, and booking confirmation.
  7. TypeScript/Python counterparts preserve the same task intent and idioms. Simplifications are narrow and documented.
  8. Exa uses one supplied role, fills only supplied non-empty applicant values, reports missing required fields, uploads the exact résumé, stops for human review, and never submits.
  9. Consequential side effects are disabled in E2E unless the public test flow explicitly requires them.
  10. Python clients use Stagehand's default endpoint: zero api_url or STAGEHAND_API_URL overrides remain. Repository CLI copy uses browse, not bb.
  11. All 79 entrypoints have fresh evidence and one external validator; blockers and probabilistic behavior are reported without inferring success.
  12. Human review remains the merge gate; this automation did not merge the PR.

The per-entrypoint matrix also checks README/live-site task alignment: 70 entrypoints map to the current public catalog and nine are repository-only. Three public-copy caveats remain transparent: Exa's safe one-role review flow is narrower than “apply at scale”; Gemini CUA pages still use older CUA/V3 naming while these templates use V4 code mode; Image URL Download now uses the first-party Fetch API although the site still describes browser-session downloads.

Notable final outcomes

  • Nurse verification: both SDKs pass with semantic act / observe / extract; there is no locator/evaluate replacement or embedded judge.
  • Exa: both SDKs pass the simplified one-role, review-only flow.
  • Gemini: the illustrative live eclipse-research prompt is restored across the three variants. Output is checked only by the external harness; TypeScript performs a tool-free synthesis only when the agent exhausts tools without final text. Python Gemini CUA now follows stagehand/main, matching the other Deep Agents templates.
  • Contexts: create/delete now uses the first-party Browserbase SDK in TypeScript and Python. An explicit empty delete body is required by the current generated SDK/API behavior and was live-smoked.
  • Image download: semantic extract remains the discovery path; the Browserbase SDK Fetch API downloads assets. Exact DOM URL reading is used only after semantic candidates are empty or all un-fetchable.
  • Proxy and link flakes: TypeScript Proxies now falls back from ipinfo.io to a second public geolocation endpoint; Python Website Link Tester falls back to exact DOM href acquisition only after extract yields no usable link.
  • Review simplifications: redundant accessibility-reference caveats and Business Lookup's unproven call-limit/immediate-return clauses are removed. Cartesia radio interpretation now uses semantic Stagehand actions instead of a string-matching heuristic.
  • Model Router: Smart Fetch Scraper and Website Link Tester now omit explicit model names. Smart Fetch also contains close-socket cleanup warnings so a completed extraction is not converted into a task failure.
  • Cleanup-only failures: Form Filling and Polymarket preserve successful task outcomes while containing close-socket warnings during teardown.

Fresh flake record

The complete run observed transient failures rather than hiding them: one empty TypeScript cache observe, one Python Amazon structured parse miss, one TypeScript proxy endpoint fetch failure, one Python link-extraction miss, and cleanup socket failures after successful Form Filling/Polymarket outcomes. Focused reruns also observed one Amazon page-readiness timeout before extraction, intermittent Cartesia direct-click CDP failures, and one routed Website Link Tester extraction containing invalid URLs; the replacement Amazon run passed, Cartesia uses semantic observe → act only after direct semantic act cannot complete the interaction, and Website Link Tester then passed 3 consecutive routed runs. Unchanged reruns or the minimum scoped fixes above passed. Gemini and the Next.js HITL flow showed substantial latency variability; they passed but should not be treated as deterministic-duration examples.

Repository proof

Check Fresh result
Entrypoint E2E 72 PASS, 7 BLOCKED, 0 FAIL across 79 entries
External validators 79/79 validator wrappers present
Policy scan 79/79 aligned; zero explicit Stagehand endpoint overrides or handwritten Browserbase REST
Source checks README index, Prettier, ESLint, Ruff lint/format, and Python compilation pass
Go Real Hacker News entrypoint compiled and executed successfully in the E2E runtime; host go vet was unavailable on this devbox
Patch integrity git diff --check passes
Published head/tree c87e1c0 / 08fc487690981454330a636b9d659760a55f090d

Comparison limitation

A literal fresh V3/V4 runtime A/B was not practical for all 79 entrypoints: some V3 APIs/models are superseded, six flows require unavailable login secrets, one credential is out of quota, and some tasks have consequential side effects. Task intent was compared against origin/dev and the live public catalog. Every runtime claim above comes only from fresh V4 executions in this audit.


Note

High Risk
Repo-wide SDK rewrite (TS/Python/Go) plus new BYO-agent orchestration, MCP/code-mode, and credential model (AI_GATEWAY_API_KEY). Scope and API-surface change are large even though these are example templates.

Overview
Migrates all Stagehand templates (TS, Python, Go) from V3 session APIs to Stagehand V4 (@browserbasehq/stagehand@4.0.0, stagehand==4.0.0, Go sdk-go/v4@v4.0.2).

Lifecycle: examples now browserbase.launch() / Stagehand.create({ browser }), use { data, metadata } results, and close Stagehand then the browser. Docs and the root template index point at V4; primitives use Browserbase Model Gateway (BROWSERBASE_API_KEY only).

Agents: V3 agent() / CUA / Sessions.Execute are gone. Eight TS templates use Vercel AI SDK ToolLoopAgent + Stagehand code mode (code_execute, git-pinned @browserbasehq/stagehand-codemode until publish). Four Python templates use LangChain Deep Agents over MCP (run / snapshot / screenshot) and AI_GATEWAY_API_KEY. Go Hacker News is an explicit Observe → Act → typed Extract flow.

Non-agent examples are rewritten to the same V4 primitives (Amazon, caching, reCAPTCHA, Reducto downloads, Cartesia form fill, etc.), with Python requiring 3.11–3.13.

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

@socket-security

socket-security Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@shrey150
shrey150 marked this pull request as ready for review August 10, 2026 19:20
@shrey150
shrey150 requested a review from a team as a code owner August 10, 2026 19:20
Comment thread typescript/amazon-product-scraping/index.ts Outdated
Comment thread typescript/amazon-product-scraping/index.ts Outdated
Comment thread typescript/browserbase-reducto/index.ts
Comment thread python/cartesia-form-filling/stagehand_form_filler.py Outdated
Comment thread typescript/exa-browserbase/index.ts Outdated
Comment thread typescript/exa-browserbase/index.ts Outdated
@shrey150 shrey150 changed the title Update TypeScript templates to Stagehand V4 Migrate all Stagehand templates to V4 Aug 11, 2026
Comment thread go/hackernews/main.go Outdated
Comment thread python/cartesia-form-filling/stagehand_form_filler.py Outdated
Comment thread python/cartesia-form-filling/stagehand_form_filler.py Outdated
Comment thread python/exa-browserbase/main.py Outdated
Comment thread typescript/pickleball/index.ts
Comment thread python/amazon-product-scraping/main.py
Comment thread typescript/mfa-handling/index.ts
Comment thread typescript/exa-browserbase/index.ts Outdated
Comment thread python/exa-browserbase/main.py
Comment thread python/exa-browserbase/main.py
Comment thread python/exa-browserbase/main.py
Comment thread python/image-url-download/main.py
Comment thread python/amazon-product-scraping/main.py Outdated
Comment thread python/context/main.py Outdated
Comment thread python/gemini-cua/main.py
Comment thread python/image-url-download/main.py Outdated

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5f7ce32. Configure here.

Comment thread typescript/image-url-download/index.ts
Comment thread typescript/proxies/index.ts
Comment thread go/hackernews/README.md Outdated
Comment thread python/browserbase-reducto/main.py
Comment thread python/browserbase-reducto/main.py Outdated

SERVER_NAME = "stagehand_browser"

STAGEHAND_DEEPAGENTS_SOURCE = (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fast follow: publish codemode MCP so that external integrations (like templates or eve external PR) can consume it without having to pin to a GitHub commit / repo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed as an upstream fast-follow. There is not yet a published codemode MCP package for this template to consume, so this PR retains the reviewed source dependency until that first-class package exists; no additional template-side workaround is warranted.

Comment thread python/business-lookup/main.py Outdated
Comment thread python/cartesia-form-filling/stagehand_form_filler.py Outdated
Comment thread python/gemini-cua/agent_runtime.py Outdated
Comment thread typescript/smart-fetch-scraper/index.ts Outdated
Comment thread typescript/website-link-tester/index.ts Outdated
@shrey150
shrey150 merged commit 9763ed5 into dev Aug 21, 2026
4 checks passed
Kylejeong2 pushed a commit that referenced this pull request Sep 25, 2026
* Update TypeScript templates to Stagehand V4

* Use code mode for V4 agent templates

* Harden live template outcomes

* Use published Stagehand V4 package

* Harden V4 templates with live outcome validation

* fix: address review comments

* feat: migrate Python templates to Stagehand V4

* fix: complete credentialed TypeScript template flows

* feat: migrate Go template to Stagehand V4

* fix: harden reviewed template inputs

* fix: avoid newest-story validation race

* fix: disambiguate spoken radio answers

* fix: reject uncertain spoken answers

* style: align Go template with V4 docs

* chore: pull Python integration from Stagehand main

* fix: verify omitted GitHub application field

* fix: make context and pickleball standalone

* fix: address fresh v4 e2e failures

* fix: preserve template Stagehand primitives

* fix: retry nurse result extraction

* fix: stabilize Exa application reviews

* restore Stagehand primitive-first template flows

* restore code-mode agent prompt behavior

* simplify Exa application workflow

* fix: stabilize remaining V4 template smoke tests

* test templates out of band and preserve Stagehand primitives

* Address final template review feedback

* Harden proxy region validation

* Address SDK review and remove redundant extract caveats

* Address latest template review feedback

* Use Model Router in remaining templates

---------

Co-authored-by: Shrey Pandya <3813908+shrey150@users.noreply.github.com>
Kylejeong2 added a commit that referenced this pull request Sep 25, 2026
* jaysahnan/gro-811-recaptcha-template (#28)

* init commit

* updating model

* Add MFA Handling - TOTP Automation Template (#25)

* init commit

* Add MFA-handling template updates and check script

- Updated MFA-handling Python and TypeScript templates
- Added 'check' script to package.json for running all formatting and linting checks

* addressing PR comments

* jaysahnan/gro-809-manual-mfa-with-contexts (#26)

* init commit

* addressing PR comments

* Add basic-caching template (#27)

* jaysahnan/gro-812-proxies-weather-template (#29)

* init commit

* addressing PR comments

* add go hackernews extraction template (#37)

* init commit (#42)

* init commit (#43)

* Add cartesia-form-filling template (#47)

* Add cartesia-form-filling template

Adds a voice-based form-filling agent template using Cartesia's LINE SDK and Google Gemini for conducting structured questionnaires.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* Replace with browserbase integration example

Uses the correct cartesia-ai/line example_integrations/browserbase folder
which integrates Cartesia LINE with Stagehand for voice-driven form filling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix README install instructions

Use pip install . instead of pip install -r requirements.txt
since pyproject.toml is used for dependencies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>

* Jaysahnan/gro 926 mfa template with playwright (#48)

* init commit

* changed to toml

* changes to readme

* fixed NITS

* init commit (#45)

* jaysahnan/gro-954-amazon-global-price-comparision (#52)

* init commit

* addressing PR comment

* jaysahnan/gro-955-google-trends-template (#53)

* init commit

* addressing PR

* jaysahnan/gro-951-sec-research-template (#51)

* init commit

* addressing PR comments

* jaysahnan/gro-950-amazon-product-fetcher-template (#50)

* inti commit

* formating

* addressing PR comments

* Exa-Browserbase-Template (#34)

* init commit

* added python version

* Replace exa-browserbase-1 with exa-browserbase (TypeScript)

* adding package.json, Exa import fix

* addressing Pr comments

* Migrate Python templates from Stagehand SDK v2 to v3 (#41)

* Restore descriptive comments in Python v3 templates

Restore important descriptive comments across all 18 Python templates:
- Replace "V3 BYOB architecture" with "cloud-based browser automation"
- Add "Connect to the browser via CDP" comments before sync_playwright sections
- Restore Pydantic model explanations and compatibility notes
- Restore caching behavior and context management documentation
- Restore login/navigation sequence explanations
- Keep all Pydantic models using model_json_schema() for extract

All templates tested for correctness where API keys available.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* Simplify Python templates to use pure Stagehand API

Address PR review feedback:
- Remove Playwright CDP connection from templates that only use act() and extract()
- Use client.sessions.navigate() instead of page.goto()
- Move session.end() to finally blocks to avoid duplicate calls
- Remove unnecessary inline schema comment
- Update READMEs with simplified quickstart instructions

Affected templates: council-events, license-verification, form-filling,
polymarket-research

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>

* init commit (#54)

* init commit (#55)

* jaysahnan/gro-982-extend-browserbase-template (#56)

* init commit

* addressing PR comments

* pin versions

* Migrate extend-browserbase templates to Extend API v2026-02-09 (#58)

- Replace processor/processorRun pattern with inline config via client.extract()
- Remove getOrCreateProcessor/get_or_create_processor and EXTEND_PROCESSOR_ID
- Rename config.parser to config.parseConfig, remove config.type
- Update file upload: client.file.upload() → client.files.upload()
- Unwrap API responses (response.id instead of response.processor.id)
- Bump extend-ai SDK: TS ^0.0.18 → ^1.0.2, Python >=0.0.21 → >=1.0.0
- Update READMEs and .env.example files

Co-authored-by: Claude (claude-opus-4-6) <noreply@anthropic.com>

* Add Cerebras docs checker template (#60)

* Add Cerebras docs checker Python template

4-phase documentation checker: crawl docs via parallel Stagehand BYOB workers,
discover the source GitHub repo, clone it, and verify docs accuracy against
source code using Cerebras tool-calling agent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add inline comments to match other Python template conventions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Update typescript example for manual-mfa-with-contexts template (#63)

* Bump JS SDK to v2.7 and Python SDK to v1.5, remove project_id from API calls (#65)

* Bump JS SDK to v2.7 and Python SDK to v1.5, remove project_id from API calls

- Bump @browserbasehq/sdk to ^2.7.0 in all TypeScript templates
- Bump browserbase to >=1.5.0 in all Python templates
- Remove projectId/project_id from bb.sessions.create(), bb.contexts.create(),
  and browserbaseSessionCreateParams/browserbase_session_create_params since
  it no longer needs to be explicitly set

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove empty object args from sessions.create() and contexts.create()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* readmes and env examples

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add smart-fetch-scraper template (Fetch API + browser fallback) (#67)

* feat: add smart-fetch-scraper template — Fetch API + browser fallback

* feat: add package.json for smart-fetch-scraper

* feat: add .env.example for smart-fetch-scraper

* feat: add README for smart-fetch-scraper

* add more robust browser fallback checks

* refactor code

* refactor readme

* update code + add example sites in readme

* chore: remove package-lock.json from tracking and add .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* link directly to fetch

* fix relative cd path command in quickstart

* remove stagehand, just use playwright page.content when falling back to browser

* Revert "remove stagehand, just use playwright page.content when falling back to browser"

This reverts commit 76c0db5.

* adding python example

---------

Co-authored-by: Alex Qiu <alexander@browserbase.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jay Sahnan <jay@browserbase.com>

* Extract image URLs with Stagehand and download images (#68)

* typescript: image download template using stagehand extract to pull image urls

* add Python template

* rm gitignore

* fix try catch handling in TS example

* update gitignore

* wrap file write in try/except

* revert root .gitignore and uv.lock changes — out of scope for this PR

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* catch non-numeric strings set in max images and fall back to default 10

* python: missing bb api key error instead of accepting;

* update ts exampel to wait until network idel, as we are extracting images

* typescript match python behavior by validating urls

* clean up image-url-download templates to match repo conventions

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jay Sahnan <jay@browserbase.com>

* Add getting-started-with-browserbase template (Search, Fetch, Sessions) (#69)

* feat: add getting-started-with-browserbase template (Search, Fetch, Sessions)

* addressed PR comments

* Fix broken documentation links across templates (#77)

Replace 8 dead URLs with current equivalents:
- docs.browserbase.com/features/sessions → /fundamentals/create-browser-session
- docs.browserbase.com/integrations/playwright/python → /introduction/playwright
- docs.browserbase.com/stagehand/extract → docs.stagehand.dev/v3/basics/extract
- docs.stagehand.dev/basics/navigate → /v3/references/page
- docs.stagehand.dev/basics/execute → /v3/basics/act
- docs.stagehand.dev/python → /v3/sdk/python
- docs.stagehand.dev/reference/python/overview → /v3/sdk/python
- github.com/browserbase/stagehand/tree/main/examples → browserbase.com/templates

* [CE-869] Add human-in-the-loop agent template (#72)

* Fix Build for Agent Template (#84)

* Migrate Puppeteer quickstart into templates (#80)

* Add Puppeteer JavaScript quickstart template

* small fix

* small fix

* Migrate Selenium Python quickstart into templates repo with modernized Selenium API (#78)

* Migrate Selenium Python quickstart into monorepo

* small readme fix

* Fix Selenium quickstart session handling and waits

Applied via @cursor push command

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* Add Selenium TypeScript quickstart template (#79)

* Add Selenium TypeScript quickstart template

Adds typescript/selenium/quickstart-selenium/ mirroring the Python
Selenium quickstart. Navigates SFMOMA, clicks interactive elements,
and extracts page copy using typed Selenium WebDriver.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* addressing bug bot fixes

* small fix

* small readme update

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add Playwright quickstart templates for TypeScript and Python (#81)

* adding playwright templates

* addressing nits

* fix: small readme and code fix

* add toml file

* fix

* feat(browser-agent): adding browser agent demo from docs to templates… (#85)

* feat(browser-agent): adding browser agent demo from docs to templates + prettier/eslint

* update readme

* Migrate templates to Model Gateway — remove separate model API keys, bump SDKs (#76)

* Migrate templates to Browserbase Model Gateway

* Fix Model Gateway naming and remove CUA notes from READMEs

* using correct package version

* updated stagehand package version to use latest

* Remove BROWSERBASE_PROJECT_ID from Stagehand templates

* bumped bb sdk versons

* Flatten README template list for agent discoverability (#86)

* Flatten README template list for agent discoverability

Add a single searchable table of all 80+ templates with name, language,
and one-line description so agents and humans can quickly find relevant
templates without navigating subdirectories.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ci: validate README template index

* fix: align README template index with tracked templates

* ci: streamline README index workflow

* ci: bump checkout action

* docs: group template index by language

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [DASH-1732] [templates] add build step to create javascript templates (#75)

* init

* add a build step that turns new ts templates into js in CI

* add file filter to build script

* add built js templates

* add exclude flag

* add comments to explain build filters

* add build step to run on dev branch in CI

* regen templats on each pr merge

* include all readme, package json and env examples in build

* get paths to build js files first so that the entire repo isn't deleted and rewritten with new build

* remove built js files

* only build js files to production branch

* remove build javascript workflow

* before recursing, skip directories whose basename is in DEFAULT_EXCLUDED_DIRS

* before recursing, skip directories whose basename is in DEFAULT_EXCLUDED_DIRS

* if there are zero playground compatible templates, do not call build-javascript.mjs

* add test-production branch support

* build js templates

* remove built js files

* add pkg.type = module to adaptPackageJsonForJavaScript so it's unconditionally set for all generated JS templates

* consolidate workflows to one plauground.yml file to remove need to make updates to it twice

* write contents to test-production and production branches

* use hardcoded branch names instead of unused var

* add --no-verify flag to build

* add stripLeadingTscBuildCommand to handle when multiple commands exist alongside tsc

* add parseBuildOptions to parse CLI flags at once instead of in multiple places to prevent drift

* [DASH-2089] [templates] smart-fetch-scraper: comment about Fetch markdown/json formats (#98)

* Migrate all Stagehand templates to V4 (#101)

* Update TypeScript templates to Stagehand V4

* Use code mode for V4 agent templates

* Harden live template outcomes

* Use published Stagehand V4 package

* Harden V4 templates with live outcome validation

* fix: address review comments

* feat: migrate Python templates to Stagehand V4

* fix: complete credentialed TypeScript template flows

* feat: migrate Go template to Stagehand V4

* fix: harden reviewed template inputs

* fix: avoid newest-story validation race

* fix: disambiguate spoken radio answers

* fix: reject uncertain spoken answers

* style: align Go template with V4 docs

* chore: pull Python integration from Stagehand main

* fix: verify omitted GitHub application field

* fix: make context and pickleball standalone

* fix: address fresh v4 e2e failures

* fix: preserve template Stagehand primitives

* fix: retry nurse result extraction

* fix: stabilize Exa application reviews

* restore Stagehand primitive-first template flows

* restore code-mode agent prompt behavior

* simplify Exa application workflow

* fix: stabilize remaining V4 template smoke tests

* test templates out of band and preserve Stagehand primitives

* Address final template review feedback

* Harden proxy region validation

* Address SDK review and remove redundant extract caveats

* Address latest template review feedback

* Use Model Router in remaining templates

---------

Co-authored-by: Shrey Pandya <3813908+shrey150@users.noreply.github.com>

* Fix missing Browserbase SDK dependencies in generated templates (#103)

* fix: add Browserbase SDK dependency for download-financial-statements

* fix: add Browserbase SDK dependency for job-application

* Make direct template clones self-contained (#104)

* fix: make source-cloned templates self-contained

* fix: keep link tester concurrency safe by default

* Generalize CAPTCHA solving language across templates

Update documentation and code comments to use generic CAPTCHA solving terminology throughout all template files.

* Rename basic-recaptcha directories to basic-captcha-solving

Rename all basic-recaptcha template directories to basic-captcha-solving and update all related references in configuration files and documentation.

* Remove old basic-recaptcha directories - migrated to basic-captcha-solving

---------

Co-authored-by: Jay Sahnan <79011389+jay-sahnan@users.noreply.github.com>
Co-authored-by: Shrey Pandya <shrey@browserbase.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Addison Huff <addison.huff@gmail.com>
Co-authored-by: Alex Qiu <alexander@browserbase.com>
Co-authored-by: Derek <75138022+derekmeegan@users.noreply.github.com>
Co-authored-by: Jay Sahnan <jay@browserbase.com>
Co-authored-by: Victor <93561983+victlue@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Syd Shields <86916890+syd-shields@users.noreply.github.com>
Co-authored-by: bb <bb@browserbase.com>
Co-authored-by: Shrey Pandya <3813908+shrey150@users.noreply.github.com>
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