solari-cookbook README

The project's README from github.com/solari-sdk/solari-cookbook. As one markdown file: README.md.

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-login-handoff-ts TypeScript Hand the live session to a human to sign in, then save it
browser-session-recording-py Python Record a session, download the replay
browser-page-assertions-py Python Reject a wrong page even when navigation and screenshots succeed
browser-workers-cdp-ts TypeScript Drive a browser from a Cloudflare Worker, over raw CDP
browser-playwright-runner-ts TypeScript Run your existing Playwright suite on Solari, no local Chromium
eu-consent-evidence-ts TypeScript Pre-consent tracker evidence via raw CDP

Sandbox

Example Language What it shows
sandbox-quickstart-ts TypeScript Run a command, write and read files
sandbox-quickstart-rb Ruby Same, with no SDK and no gems — stdlib only
sandbox-code-interpreter-py Python Stateful Python kernel for agent loops
sandbox-snapshot-fork-py Python Seed a snapshot, fork clones, and verify each restored the exact file digest
sandbox-port-preview-ts TypeScript Expose a server in the VM on a public URL
sandbox-scan-untrusted-code-ts TypeScript Run untrusted code and capture what it did (audit hook)

Multi-product

One key spans all three, so an example can use more than one at once.

Example Language What it shows
form-delivery-check-ts TypeScript Submit a form in a browser, verify the lead landed in a sandbox
security-posture-review-ts TypeScript Browser and sandbox running concurrently on one key

Desktop

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

Applications

Bigger programs built on Solari — a CLI or a UI, its own modules, solving a whole problem rather than showing one call. See applications/.

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?

Gotchas the examples encode

Things that cost you an afternoon if you meet them cold:

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.

solari-cookbook (solari-sdk/solari-cookbook)

Searching Database…

What is this?A cookbook of small, runnable example programs for Solari, a service that gives you cloud browsers, sandboxes, and desktop VMs behind a single API key.
Is this a library, or just a bunch of example scripts?It is a collection of standalone example scripts, one idea per file, meant to be copied into your own project rather than imported as a package; each example calls the real Solari API directly.
How do I run one of the examples?Each example directory is self-contained: open the one you want (e.g. browser-quickstart-py or sandbox-quickstart-ts) and run it with a Solari API key; one key works across browsers, sandboxes, and desktops.
Which languages are the examples written in, and do I need an API key?Examples are written in TypeScript, Python, and Ruby (one uses only the Ruby standard library, no SDK). You need a Solari API key to run any of them.
What are the gotchas if I copy these examples into my own code?A browser profile only restores cookies, not localStorage, unless you pass storageState into newContext(); sandbox commands are not shell-interpreted, so run('ls -la') looks for a literal binary by that name; session recordings upload asynchronously, so the replay endpoint 404s for up to ~30s after you stop; and the TypeScript SDK cannot run on edge runtimes like Cloudflare Workers because it bundles a Playwright fork needing Node.
Should I use the cloud browser, the sandbox, or the desktop product?Use the cloud browser for anything you'd do with Playwright or Puppeteer on a webpage, plus stealth and managed proxies; use the sandbox when you need to run code like an LLM's Python or an untrusted build in a microVM that boots from a snapshot in about a second; use the desktop when you need a clickable screen, e.g. for computer-use agents or GUI apps.
What is the 'applications' folder for?It holds bigger programs built on Solari — full CLIs or UIs with their own modules that solve a whole problem, as opposed to the single-idea examples in the main folders.
Can I run my existing Playwright test suite against Solari?Yes — browser-playwright-runner-ts shows connecting your suite to Solari's session CDP endpoint instead of a local Chromium, which also sidesteps Playwright's version-gated wire protocol.
What does the sandbox snapshot/fork example show?sandbox-snapshot-fork-py seeds a snapshot once, forks multiple clones from it, and verifies each clone restored the exact same file digest, useful for fast, reproducible agent environments.
Does closing the browser in TypeScript hang my script?Not since @solarisdk/browser 0.1.3 — browser.close() alone now exits cleanly; before that version you also had to call solari.close() or the script would hang on an open loopback listener.
Creator
solari-sdk
Size
0.5 MB
Stars
192
Updated
CommitSep 28
Age
1mo
Commits · 90 Days