Skip to main content

Crate solari_browser

Crate solari_browser 

Source
Expand description

§solari-browser

Rust binding for the Solari Browser platform — the control plane: acquire and release pooled stealth Chromium sessions, manage stored browser profiles, pull session replays, and inspect managed-proxy egress. It speaks the same wire contract as the reference @solarisdk/browser TypeScript package (sdk/src/index.ts).

use solari_browser::{Client, ClientOptions, CreateSessionOptions, ProxySpec};

let client = Client::new(ClientOptions::default_region("slr_live_…"))?;

let session = client
    .sessions()
    .create(
        CreateSessionOptions::new()
            .stealth(true)
            .proxy(ProxySpec::country("us")),
    )
    .await?;

println!("ws  {}", session.ws_endpoint);   // Playwright wire protocol
println!("cdp {}", session.cdp_endpoint);  // raw CDP — use this from Rust

client.sessions().release(&session.id).await?;

§Scope

This crate is the control plane plus a connect() helper. There is no port of the TypeScript Solari.launch(), which hands back a live Playwright Browser — Playwright has no Rust binding. To drive a session from Rust, enable the connect feature and attach to Session::cdp_endpoint with chromiumoxide:

solari-browser = { path = "sdk/rust", features = ["connect"] }

§Endpoints vs. the TypeScript SDK

The TS SDK routes wsEndpoint / cdpEndpoint through a Node-side loopback LocalProxy. This crate has no such indirection: Session::ws_endpoint and Session::cdp_endpoint are the upstream gateway endpoints.

Structs§

ApiErrorBody
Shape the API’s error bodies may take. Every field is optional — an error body is best-effort and may not be JSON at all.
Client
Talks the Solari Browser control-plane REST API.
ClientOptions
Options for constructing a Client.
Cookie
One cookie in a StorageState.
CreateSessionOptions
Options accepted by POST /sessions.
LocalStorageEntry
One localStorage key/value pair.
Profile
A stored browser profile (cookies + localStorage).
ProfileSaveResult
Result of POST /profiles/:id/save.
Profiles
The profiles namespace. Obtain via Client::profiles.
Proxy
The proxy namespace. Obtain via Client::proxy.
ProxyCountries
GET /proxy/countries — supported egress countries, plus whether the gateway actually has residential credentials configured.
ProxyRequest
Managed proxy egress request.
ReplayUrl
Presigned URL for a session’s replay.
ResolvedProxyConfig
Coarse confirmation of the proxy the gateway resolved for a session.
Session
A live browser session.
SessionView
GET /sessions/:id. The API proxies the pool’s view through verbatim, so every field is optional and unknown keys land in SessionView::extra.
Sessions
The sessions namespace. Obtain via Client::sessions.
StorageOrigin
One origin’s localStorage in a StorageState.
StorageState
A browser profile’s persisted state — Playwright’s storageState shape. Unknown keys round-trip through StorageState::extra.

Enums§

ProxySpec
What to send as the proxy field of POST /sessions.
ProxyTier
Managed proxy tier.
SameSite
Cookie sameSite policy, as Playwright spells it.
SolariError
Every error raised by this crate.
SolariErrorCode
Machine-readable error codes the API returns in a { "code": … } body.
SolariRegion
Supported Solari regions. More coming soon.