Skip to content
 
 

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Solari Cookbook

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.

Examples

Cloud browser

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

Sandbox

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

Desktop

Example Language What it shows
desktop-computer-use-py Python Screenshot, click, and type on a Linux GUI

Running an example

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.py

One slr_live_ key works across browsers, sandboxes, and desktops, and every product bills to the same balance.

Which product do I want?

  • 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.

Gotchas the examples encode

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: true when 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 named ls -la. Put argv in args, or run sh -c explicitly.
  • kill(), not close(), ends a VM. close() drops your local control channel; the VM keeps running until its idle timeout.
  • timeoutMs is a rolling idle window, not a hard deadline — it resets on every use.

Links

Contributing

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors