Quickstart
Install the SDK, mint an API key, and drive a real browser in under a minute.
Install
npm install @solarisdk/browserThat's it. The SDK ships its own browser client. No Playwright or Patchright install needed.
Get an API key
Sign in at console.getsolari.com and create a key from the API Keys tab. You'll see the key once, right after you create it, so copy it then.
export SOLARI_API_KEY="slr_live_…"Open a session
launch() gives you a fresh browser with the standard Playwright API. When you call close(), it cleans everything up for you.
import { Solari } from "@solarisdk/browser"
const client = new Solari({
apiKey: process.env.SOLARI_API_KEY!,
baseUrl: "https://api.getsolari.com",
// region: "us-west", // default, see /regions for the full list
})
const browser = await client.launch()
const page = await browser.newPage()
await page.goto("https://example.com")
console.log(await page.title())
await browser.close() // closes the browser and cleans upDrive the browser
Everything Playwright exposes is available on the page: navigation, locators, evaluation, screenshots, waits.
const browser = await client.launch()
const page = await browser.newPage()
// Navigate and wait for the network to settle.
await page.goto("https://news.ycombinator.com", { waitUntil: "networkidle" })
// Click and type with auto-waiting locators.
await page.locator("a:has-text('login')").click()
await page.locator("input[name=acct]").fill("demo-user")
await page.locator("input[name=pw]").fill("hunter2")
// Pull data out via evaluate.
const headlines = await page.locator(".titleline > a").allInnerTexts()
// Screenshot the whole page as PNG bytes.
const png = await page.screenshot({ fullPage: true })
await browser.close()Or let it close itself
Node 22+ supports await using, which closes the browser for you when the variable goes out of scope, even if something throws.
{
await using browser = await client.launch({ stealth: true })
const page = await browser.newPage()
await page.goto("https://example.com")
// browser closes here, automatically
}Full kit
Combine stealth, a sticky residential proxy, captcha solving, and recording for the typical "scrape a defended site" shape.
const browser = await client.launch({
stealth: true,
recording: true,
captcha: true,
proxy: { country: "us", session: "warmup-1", sessionDuration: 10 },
})
const page = await browser.newPage()
await page.goto("https://example.com")
const sessionId = browser.id
await browser.close()
// The replay is ready a few seconds after you close.
const { url } = await client.sessions.getReplayUrl(sessionId)
console.log("replay:", url)Next
- Sessions: options and usage.
- Profiles: persistent login state.
- Proxies: country, sticky, and static ISP.
- Captcha solving: auto-solve widgets.
