Short, runnable examples for Solari — cloud browsers, sandboxes, and desktops behind one API key.
Every example in this repo is a complete program 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 |
| Example | Language | What it shows |
|---|---|---|
| desktop-computer-use-py | Python | Screenshot, click, and type on a Linux GUI |
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: call
await solari.close(). The browser client keeps a loopback proxy open for connection retries. Skip the close and your script prints its output and then hangs forever instead of exiting. - 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.