SDK Reference
Lifecycle
Instance creation, browser launch, attachment, and cleanup.
launch
launch(options?: LaunchOptions): Promise<void>
Launch a local or cloud browser session.
const opensteer = new Opensteer({ name: 'demo' })
await opensteer.launch()
// With options
await opensteer.launch({ headless: true })
from
static from(page: Page, config?: OpensteerConfig): Promise<Opensteer>
Wrap an existing Playwright Page. Local only — not supported in cloud mode.
import { chromium } from 'playwright'
const browser = await chromium.launch()
const page = await browser.newPage()
const opensteer = await Opensteer.from(page, { name: 'existing' })
close
close(): Promise<void>
Close the browser and release resources. In cloud mode, also terminates the cloud session.
try {
await opensteer.launch()
// ... work
} finally {
await opensteer.close()
}
getConfig
getConfig(): ResolvedConfig
Return the resolved configuration object.
getNamespace
getNamespace(): string
Return the resolved selector namespace string.
getStorage
getStorage(): SelectorStorage
Return the local selector storage instance.
clearCache
clearCache(): void
Clear all persisted selectors and snapshot cache for the current namespace.
