sdk/src/stagehand.ts
Export Index
| Export | Kind | Source | Notes |
|---|---|---|---|
RemoteStagehandContext | class | sdk/src/drivers/stagehand/generated/context.ts | RemoteStagehandContext - Remote Puppeteer Context API over RPC. |
RemoteStagehandLocator | class | sdk/src/drivers/stagehand/generated/locator.ts | RemoteStagehandLocator - Remote Puppeteer Locator API over RPC. |
RemoteStagehandPage | class | sdk/src/drivers/stagehand/generated/page.ts | RemoteStagehandPage - Remote Puppeteer Page API over RPC. |
RemoteStagehandResponse | class | sdk/src/drivers/stagehand/generated/response.ts | RemoteStagehandResponse - Remote Puppeteer Response API over RPC. |
StagehandClickOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandDragAndDropOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandFileInput | type | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandFilePayload | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandGotoOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandHeaderEntry | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandHighlightOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandHoverOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandInitScriptSource | type | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandLoadState | type | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandLocatorClickOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandLocatorTypeOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandReloadOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandScreenshotClip | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandScreenshotOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSecurityDetails | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSendClickEventOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandServerAddr | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSession | class | sdk/src/drivers/stagehand/session.ts | - |
StagehandSnapshotOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSnapshotResult | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandTypeOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandViewportOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandViewportSize | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandWaitForSelectorOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
Classes
RemoteStagehandContext
Source:sdk/src/drivers/stagehand/generated/context.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
id | string | readonly |
Methods
activePage
Get the currently active page.addInitScript
Inject JavaScript that runs before any page scripts on every navigation.close
Close the browser context and all associated pages.markClosed
Mark this context as closed (internal use).newPage
Create a new page (tab) in the browser.pages
Get all open pages in the browser context.setActivePage
Set a specific page as the active page.RemoteStagehandLocator
Source:sdk/src/drivers/stagehand/generated/locator.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
selector | string | readonly |
Methods
backendNodeId
Get the DOM backend node ID for the element.centroid
Get the center coordinates of the element.click
Click the element at its visual center.clone
Clones the locator.count
Return the number of elements matching this locator.fill
Fill an input, textarea, or contenteditable element.first
Return a locator for the first matching element.highlight
Visually highlight the element with an overlay.hover
Move the mouse cursor to the element’s center without clicking.innerHtml
Get the element’s inner HTML.innerText
Get the element’s visible text (layout-aware).inputValue
Get the current value of an input element.isChecked
Check if a checkbox or radio button is checked.isVisible
Check if the element is visible.nth
Return a locator for the nth matching element.scrollTo
Scroll the element to a specific position.selectOption
Select one or more options in a <select> element.sendClickEvent
Dispatch a DOM click event directly on the element.setInputFiles
Set files on an <input type=“file”> element.textContent
Get the element’s text content (raw).type
Type text into the element with optional delay between keystrokes.RemoteStagehandPage
Source:sdk/src/drivers/stagehand/generated/page.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
id | string | readonly |
Methods
addInitScript
Add an initialization script that runs before page scripts.click
Click at the specified coordinates.deepLocator
Create a deep locator that can traverse iframes and shadow roots.dragAndDrop
Drag from one point to another.evaluate
Execute JavaScript code within the page context.goBack
Navigate to the previous page in history.goForward
Navigate to the next page in history.goto
Navigate the page to a URL.hover
Hover at the specified coordinates.locator
Create a locator for an element using a CSS or XPath selector.off
Remove an event listener.on
Register an event listener.once
Register a one-time event listener.reload
Reload the current page.screenshot
Capture a screenshot of the page.scroll
Scroll at the specified position by the given delta.setViewportSize
Set the viewport size of the page.snapshot
Get a snapshot of the page DOM.title
Get the title of the page.type
Type text into the currently focused element.url
Get the current URL of the page.waitForLoadState
Wait for the page to reach a specific load state.waitForSelector
Wait for an element matching the selector to appear.RemoteStagehandResponse
Source:sdk/src/drivers/stagehand/generated/response.ts
Constructor
Methods
allHeaders
Get all response headers including those not exposed by the standard API.body
Get the response body as a Buffer.finished
Wait for the response to finish and get any error message.frame
Get the frame that initiated this response (synchronous version). Note: Not fully supported in remote SDK.fromServiceWorker
Check if the response was served from a service worker.headers
Get all response headers as an object.headersArray
Get all response headers as an array of { name, value } objects.headerValue
Get the value of a specific header.headerValues
Get all values of a specific header (for headers with multiple values).json
Get the response body parsed as JSON.ok
Check if the response status is in the 200-299 range.securityDetails
Get the security details of the response (for HTTPS).serverAddr
Get the server address (IP and port) that served the response.status
Get the HTTP status code of the response.statusText
Get the HTTP status text of the response.text
Get the response body as text.url
Get the URL of the response.StagehandSession
Source:sdk/src/drivers/stagehand/session.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
page | RemoteStagehandPage | getter • Get the default/active page. |
External Re-exports
| Export | Kind | Source | Notes |
|---|---|---|---|
StagehandClickOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandDragAndDropOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandFileInput | type | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandFilePayload | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandGotoOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandHeaderEntry | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandHighlightOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandHoverOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandInitScriptSource | type | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandLoadState | type | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandLocatorClickOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandLocatorTypeOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandReloadOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandScreenshotClip | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandScreenshotOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSecurityDetails | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSendClickEventOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandServerAddr | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSnapshotOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandSnapshotResult | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandTypeOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandViewportOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandViewportSize | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |
StagehandWaitForSelectorOptions | interface | packages/schemas/src/drivers/stagehand/types.ts | Re-exported from non-SDK source |

