Reference
SDK Methods
Complete SDK method reference
Construction
import { Opensteer } from "opensteer";
const os = new Opensteer({
workspace: "demo", // workspace identifier (required)
rootDir: process.cwd(), // root directory for .opensteer state
browser: "persistent", // "persistent" | "temporary" | "attach"
launch: {
headless: false, // run headless
attachEndpoint: undefined, // CDP endpoint for attach mode
},
provider: { mode: "local" }, // "local" or "cloud"
});
Session Lifecycle
| Method | Description |
|---|---|
open(url) | Open browser and navigate to URL |
goto(options) | Navigate to URL. Options: { url, captureNetwork? } |
close() | Close the browser session |
disconnect() | Detach from session without closing browser |
info() | Get current session info (URL, title) |
Snapshots
| Method | Description |
|---|---|
snapshot(mode) | Capture DOM snapshot. Mode: "action" or "extraction" |
DOM Actions
| Method | Description |
|---|---|
click(target) | Click element. Target: { element?, description?, selector? } |
input(target) | Type into input. Target: { element?, description?, selector?, text, pressEnter?, clearFirst? } |
hover(target) | Hover over element |
scroll(options) | Scroll page/element. { direction, amount, element? } |
select(target) | Select dropdown option. { element?, description?, selector?, value } |
uploadFile(target) | Upload file. { element?, description?, selector?, filePath } |
pressKey(options) | Press keyboard key. { key } |
type(options) | Type text at focus. { text } |
JavaScript Evaluation
| Method | Description |
|---|---|
evaluate(options) | Execute JavaScript in the page context |
evaluateJson(options) | Execute JS and parse result as JSON |
Extraction
| Method | Description |
|---|---|
extract(options) | Extract data. { description, schema? } |
Tabs
| Method | Description |
|---|---|
listPages() | List open pages/tabs |
activatePage(options) | Switch to a page by index or URL |
newPage(options) | Open a new page/tab |
closePage(options) | Close a page/tab |
waitForPage(options) | Wait for a new page to open |
Cookies & Storage
| Method | Description |
|---|---|
getCookies(filter?) | Get cookies, optional filter by name/domain |
getStorageSnapshot() | Get localStorage, sessionStorage, IndexedDB snapshot |
Network
| Method | Description |
|---|---|
queryNetwork(options) | Query captured traffic. { capture, tag?, includeBodies? } |
tagNetwork(options) | Tag a network record. { recordId, tags } |
clearNetwork(options) | Clear captured records |
Request Plans & Recipes
| Method | Description |
|---|---|
inferRequestPlan(options) | Infer plan from captured record |
writeRequestPlan(options) | Write a request plan to registry |
getRequestPlan(options) | Get a request plan |
listRequestPlans() | List all request plans |
request(key, params?) | Execute a request plan |
writeRecipe(options) | Write a recipe |
getRecipe(options) | Get a recipe |
listRecipes() | List recipes |
runRecipe(options) | Run a recipe |
writeAuthRecipe(options) | Write an auth recipe |
getAuthRecipe(options) | Get an auth recipe |
listAuthRecipes() | List auth recipes |
runAuthRecipe(options) | Run an auth recipe |
Instrumentation
| Method | Description |
|---|---|
addInitScript(options) | Inject script on page load. { script } |
route(options) | Intercept network requests. { urlPattern, handler } |
Script Tools
| Method | Description |
|---|---|
captureScripts(options) | Capture page scripts. { persist? } |
beautifyScript(options) | Format/prettify a script |
deobfuscateScript(options) | Deobfuscate a script |
sandboxScript(options) | Run script in sandbox |
Network Utilities
| Method | Description |
|---|---|
minimizeNetwork(options) | Strip unnecessary fields from a request |
diffNetwork(options) | Diff two network records |
probeNetwork(options) | Test a request with modifications |
Reverse Engineering
| Method | Description |
|---|---|
reverseDiscover(options) | Discover API endpoints from traffic |
reverseQuery(options) | Query reverse engineering results |
Computer Use
| Method | Description |
|---|---|
computerExecute(options) | Execute coordinate-based action (screenshot, click, type, scroll, etc.) |
Browser Admin
| Method | Description |
|---|---|
readArtifact(options) | Read a stored artifact |
