Short, runnable examples for Solari — cloud browsers, sandboxes, and desktops behind one API key.
The quickstart examples are complete programs you can run in under a minute. They are deliberately small: one idea each, no framework, no scaffolding to read past. Copy one into your project and change the parts you care about.
| Example | Language | What it shows |
|---|---|---|
| browser-quickstart-ts | TypeScript | Launch a browser, open a page, read it |
| browser-quickstart-py | Python | Launch a browser, open a page, read it |
| browser-stealth-proxy-ts | TypeScript | Stealth mode + residential proxy egress |
| browser-profiles-ts | TypeScript | Log in once, reuse the session forever |
| browser-session-recording-py | Python | Record a session, download the replay |
| Example | Language | What it shows |
|---|---|---|
| sandbox-quickstart-ts | TypeScript | Run a command, write and read files |
| sandbox-code-interpreter-py | Python | Stateful Python kernel for agent loops |
| sandbox-port-preview-ts | TypeScript | Expose a server in the VM on a public URL |
Autonomous functional QA builds on the browser and sandbox examples: bounded workflow testing, safe reproduction, and screenshot evidence for authorized applications. This larger project requires a model API key for autonomous planning; a separate scripted Solari integration check needs only a Solari key.
Each directory is self-contained.
git clone https://github.com/solari-sdk/solari-cookbook.git
cd solari-cookbook/examples/browser-quickstart-ts
npm install # or: pip install -r requirements.txt
export SOLARI_API_KEY=slr_live_... # grab one at console.getsolari.com
npm start # or: python main.pyOne slr_live_ key works across browsers, sandboxes, and desktops, and every
product bills to the same balance.
- Cloud browser — you need a web page: scraping, testing, filling forms, anything Playwright or Puppeteer would do locally. Adds stealth, managed proxies, captcha solving, profiles, and session recording.
- Sandbox — you need to run code: an LLM's Python, an untrusted build, a data job. A headless microVM that boots from a snapshot in about a second.
- Desktop — you need a screen: computer-use agents, GUI apps, anything that has to be clicked. A sandbox plus X11 and a live VNC stream.
Things that cost you an afternoon if you meet them cold:
- TypeScript:
browser.close()is enough to exit (as of@solarisdk/browser0.1.3). The client keeps a loopback proxy open for connection retries; before 0.1.3 that listener held Node's event loop open, so you had toawait solari.close()or the script printed its output and then hung forever. 0.1.3 unrefs the listener —browser.close()alone now exits. Callingsolari.close()is still fine and releases the client's pool immediately. - Recording is per session, not per account. Pass
recording: truewhen you create the session; without it the replay endpoint 404s forever. The upload is async after release, so poll for ~30s before giving up. - Sandbox commands are not shell-interpreted.
run("ls -la")looks for a binary namedls -la. Put argv inargs, or runsh -cexplicitly. kill(), notclose(), ends a VM.close()drops your local control channel; the VM keeps running until its idle timeout.timeoutMsis a rolling idle window, not a hard deadline — it resets on every use.
- Docs — docs.getsolari.com
- Console — console.getsolari.com
- Changelog — changelog.getsolari.com
- Questions — hello@getsolari.com
New examples are welcome. Keep them small, make them run end-to-end against the real API, and put anything surprising in a comment right where it bites.
MIT licensed.
