Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
82272c6
jaysahnan/gro-811-recaptcha-template (#28)
jay-sahnan Dec 29, 2025
4654cd6
Add MFA Handling - TOTP Automation Template (#25)
jay-sahnan Jan 6, 2026
486093a
jaysahnan/gro-809-manual-mfa-with-contexts (#26)
jay-sahnan Jan 6, 2026
78b6631
Add basic-caching template (#27)
jay-sahnan Jan 6, 2026
80ce301
jaysahnan/gro-812-proxies-weather-template (#29)
jay-sahnan Jan 6, 2026
d75cd60
add go hackernews extraction template (#37)
Kylejeong2 Jan 20, 2026
1d7a23d
init commit (#42)
jay-sahnan Jan 22, 2026
a44a77d
init commit (#43)
jay-sahnan Jan 23, 2026
f96ef24
Add cartesia-form-filling template (#47)
shrey150 Jan 24, 2026
dc79a4b
Jaysahnan/gro 926 mfa template with playwright (#48)
jay-sahnan Jan 28, 2026
3ddbece
init commit (#45)
jay-sahnan Jan 28, 2026
ac1b0ed
jaysahnan/gro-954-amazon-global-price-comparision (#52)
jay-sahnan Feb 2, 2026
98d2b64
jaysahnan/gro-955-google-trends-template (#53)
jay-sahnan Feb 2, 2026
0dee558
jaysahnan/gro-951-sec-research-template (#51)
jay-sahnan Feb 2, 2026
ce0d85c
jaysahnan/gro-950-amazon-product-fetcher-template (#50)
jay-sahnan Feb 2, 2026
e290fd3
Exa-Browserbase-Template (#34)
jay-sahnan Feb 3, 2026
d7720fc
Migrate Python templates from Stagehand SDK v2 to v3 (#41)
shrey150 Feb 6, 2026
78b3022
init commit (#54)
jay-sahnan Feb 6, 2026
69cf92f
init commit (#55)
jay-sahnan Feb 6, 2026
d636d28
jaysahnan/gro-982-extend-browserbase-template (#56)
jay-sahnan Feb 10, 2026
3d8bfe4
Migrate extend-browserbase templates to Extend API v2026-02-09 (#58)
Addison-Huff Feb 10, 2026
436d0dd
Add Cerebras docs checker template (#60)
shrey150 Feb 13, 2026
a4cf6fb
Update typescript example for manual-mfa-with-contexts template (#63)
aq17 Feb 27, 2026
4d8f10c
Bump JS SDK to v2.7 and Python SDK to v1.5, remove project_id from AP…
derekmeegan Mar 11, 2026
0cf72cb
feat: add smart-fetch-scraper template (Fetch API + browser fallback)…
derekmeegan Mar 12, 2026
7e331d1
Extract image URLs with Stagehand and download images (#68)
aq17 Mar 23, 2026
8f83c62
Add getting-started-with-browserbase template (Search, Fetch, Session…
jay-sahnan Mar 25, 2026
43cc364
Fix broken documentation links across templates (#77)
jay-sahnan Mar 31, 2026
3b398f9
[CE-869] Add human-in-the-loop agent template (#72)
victlue Apr 1, 2026
79b3d52
Fix Build for Agent Template (#84)
victlue Apr 1, 2026
6f27b7f
Migrate Puppeteer quickstart into templates (#80)
jay-sahnan Apr 2, 2026
8fba11c
Migrate Selenium Python quickstart into templates repo with modernize…
jay-sahnan Apr 6, 2026
f971039
Add Selenium TypeScript quickstart template (#79)
jay-sahnan Apr 6, 2026
a8d0c96
Add Playwright quickstart templates for TypeScript and Python (#81)
jay-sahnan Apr 6, 2026
5a7c6f4
feat(browser-agent): adding browser agent demo from docs to templates…
Kylejeong2 Apr 6, 2026
7c5f999
Migrate templates to Model Gateway — remove separate model API keys, …
jay-sahnan Apr 7, 2026
1838511
Flatten README template list for agent discoverability (#86)
shrey150 Apr 16, 2026
c69c761
[DASH-1732] [templates] add build step to create javascript templates…
syd-shields May 13, 2026
89a9c46
[DASH-2089] [templates] smart-fetch-scraper: comment about Fetch mark…
bbclanker May 20, 2026
12168d5
Migrate all Stagehand templates to V4 (#101)
shrey150 Aug 21, 2026
3132dd8
Fix missing Browserbase SDK dependencies in generated templates (#103)
shrey150 Aug 23, 2026
35e35e8
Make direct template clones self-contained (#104)
shrey150 Aug 24, 2026
e40f0a7
Generalize CAPTCHA solving language across templates
Kylejeong2 Sep 25, 2026
568a21b
Rename basic-recaptcha directories to basic-captcha-solving
Kylejeong2 Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# When merging changes under these paths to `production`, require review from the
# Dashboard team.
/javascript/ @browserbase/dashboard
/scripts/fetch-playground-typescript-dirs.mjs @browserbase/dashboard
/scripts/validate-playground-templates.mjs @browserbase/dashboard
/scripts/playground-ci.mjs @browserbase/dashboard
/scripts/lib/playground-checks.mjs @browserbase/dashboard
/.github/workflows/playground.yml @browserbase/dashboard
/.github/workflows/playground-production.yml @browserbase/dashboard
/.github/workflows/playground-test-production.yml @browserbase/dashboard
20 changes: 20 additions & 0 deletions .github/workflows/playground-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Triggers the shared playground workflow for the `production` branch.
# All CI steps live in playground.yml — edit there to change behavior.

name: Playground templates (production)

on:
pull_request:
branches:
- production
push:
branches:
- production
workflow_dispatch:

permissions:
contents: write

jobs:
playground-templates:
uses: ./.github/workflows/playground.yml
20 changes: 20 additions & 0 deletions .github/workflows/playground-test-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Triggers the shared playground workflow for the `test-production` branch.
# All CI steps live in playground.yml — edit there to change behavior.

name: Playground templates (test production)

on:
pull_request:
branches:
- test-production
push:
branches:
- test-production
workflow_dispatch:

permissions:
contents: write

jobs:
playground-templates:
uses: ./.github/workflows/playground.yml
53 changes: 53 additions & 0 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Reusable workflow: validates TypeScript → JavaScript builds for playground-
# runnable templates and optionally commits the generated javascript/ tree.
#
# Called by playground-production.yml and playground-test-production.yml so that
# CI steps are defined in exactly one place.

name: Playground templates

on:
workflow_call:

permissions:
contents: write

jobs:
playground-templates:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Clean javascript output directory
run: rm -rf javascript && mkdir -p javascript

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build and validate playground TypeScript templates
env:
TEMPLATES_API_URL: ${{ vars.TEMPLATES_API_URL }}
run: pnpm run ci:playground

- name: Commit and push playground javascript (push only)
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A javascript/
if git diff --staged --quiet; then
echo "No javascript changes to commit."
else
git commit --no-verify -m "chore: regenerate playground javascript templates"
git push
fi
45 changes: 45 additions & 0 deletions .github/workflows/readme-template-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: README Template Index

on:
pull_request:
paths:
- "README.md"
- "go/**"
- "python/**"
- "typescript/**"
- "scripts/check-readme-template-index.mjs"
- ".github/workflows/readme-template-index.yml"
push:
branches:
- dev
paths:
- "README.md"
- "go/**"
- "python/**"
- "typescript/**"
- "scripts/check-readme-template-index.mjs"
- ".github/workflows/readme-template-index.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
validate-readme-template-index:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20.x

- name: Validate README template index
run: node scripts/check-readme-template-index.mjs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
.env
cursorrules.md
.cursorrules
.cursor

# Dependencies
node_modules/
.pnp
.pnp.js
.pnpm-store/

# Python
__pycache__/
Expand All @@ -26,6 +28,7 @@ build/
# IDE
.vscode/
.idea/
.cursor/
*.swp
*.swo
*~
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
142 changes: 75 additions & 67 deletions README.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ export default tseslint.config(
ignores: ["node_modules/**", "dist/**", "build/**", "*.config.js"],
},
);

61 changes: 61 additions & 0 deletions go/hackernews/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Stagehand + Browserbase: Hacker News Automation

Stagehand is the SDK for browser agents.

## AT A GLANCE

- Goal: demonstrate Stagehand V4's core browser automation primitives through a complete Hacker News workflow.
- Complete workflow: launch a Browserbase browser, attach Stagehand, navigate, observe, act, and extract typed data.
- Real-world outcome: open the top story's comments, extract its first comment, then extract the newest visible story.
- Docs → https://docs.stagehand.dev/v4/first-steps/quickstart

## GLOSSARY

- `LaunchBrowserbase`: create a Browserbase browser owned by the application.
- `Create`: attach Stagehand V4 to that browser.
- `Observe`: find possible page actions from a natural-language instruction.
- `Act`: execute either an observed action or a natural-language instruction.
- `Extract`: return typed structured data together with result metadata.

## QUICKSTART

1. Install Go 1.26 or newer (`go version`).
2. Set `BROWSERBASE_API_KEY` in your environment.
3. Run `go mod download`.
4. Run `go run .`.

## EXPECTED OUTPUT

- Launches a real Browserbase browser and attaches Stagehand V4.
- Navigates to Hacker News and verifies the main-document HTTP response.
- Observes and opens the comments link for the top-ranked story.
- Extracts the story title, first comment, and commenter.
- Navigates to `/newest` and extracts the newest story title.
- Explicitly closes Stagehand before closing the browser.

## COMMON PITFALLS

- Missing Go installation: ensure Go 1.26+ is installed.
- Missing credentials: verify `BROWSERBASE_API_KEY` is set.
- Module not found: run `go mod download` if dependencies are not resolved.
- No `MODEL_API_KEY` is needed: Stagehand primitives use Browserbase Model Gateway.
- Stagehand V4 does not expose an agent API. Bring your own agent framework when orchestration is required.

## USE CASES

- Content aggregation: extract structured records from news sites, forums, and social platforms.
- Research automation: combine deterministic navigation with AI-guided actions and typed extraction.
- Content automation: combine page interaction and structured extraction in a real cloud browser.

## NEXT STEPS

- Add retries for transient site or model failures.
- Extend the extraction types with points, comment count, and post age.
- Add an external Go agent framework if the workflow needs autonomous planning.

## HELPFUL RESOURCES

- Stagehand Docs: https://docs.stagehand.dev/v4/first-steps/quickstart
- Browserbase: https://www.browserbase.com
- Templates: https://www.browserbase.com/templates
- Discord: http://stagehand.dev/discord
17 changes: 17 additions & 0 deletions go/hackernews/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module stagehand-example

go 1.26.0

require github.com/browserbase/stagehand/packages/sdk-go/v4 v4.0.2

require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.2 // indirect
github.com/coder/websocket v1.8.13 // indirect
github.com/invopop/jsonschema v0.14.0 // indirect
github.com/pb33f/ordered-map/v2 v2.3.1 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.2 // indirect
golang.org/x/mod v0.38.0 // indirect
)
38 changes: 38 additions & 0 deletions go/hackernews/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/browserbase/stagehand/packages/sdk-go/v4 v4.0.2 h1:axCIlzMz6Kao32Wli7C6uZVHbEc5MzmsUDAbf2y9TXw=
github.com/browserbase/stagehand/packages/sdk-go/v4 v4.0.2/go.mod h1:Z4qkSeN4whiyoYk+jqKbwYbUPu16JgmvEZWtiiaXyqY=
github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk=
github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/invopop/jsonschema v0.14.0 h1:MHQqLhvpNUZfw+hM3AZDYK7jxO8FZoQeQM77g8iyZjg=
github.com/invopop/jsonschema v0.14.0/go.mod h1:ygm6C2EaVNMBDPpaPlnOA2pFAxBnxGjFlMZABxm9n2I=
github.com/pb33f/ordered-map/v2 v2.3.1 h1:5319HDO0aw4DA4gzi+zv4FXU9UlSs3xGZ40wcP1nBjY=
github.com/pb33f/ordered-map/v2 v2.3.1/go.mod h1:qxFQgd0PkVUtOMCkTapqotNgzRhMPL7VvaHKbd1HnmQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s=
go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=
golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading