Every example is a single self-contained file in the Box SDK
repo.
All of them need
UPSTASH_BOX_API_KEY. Examples marked AI use metered
browser AI (act, extract, observe) and need a model provider key on the box
or account. Everything else runs with the Box key alone.Agentic browsing
Goal-driven browsing: hand a goal to the box’s agent, or drive your own loop.In-box agent
Hand a goal to
box.agent.run; the box’s agent drives the browser through the chrome-devtools MCP and writes results to the box (needs an agent key; bills coding-agent tokens). AgentBuild your own loop
A live
observe then act(action) then extract loop you own, with extract as the stop check. AIAutomation
Forms, files, and durable sessions.Checkout with one AI step
Script the deterministic steps, delegate the judgment call to a single
act, and assert the result.Download and process
A download lands on the box filesystem and is processed in place.
Upload from box
Upload a box-generated file through a real form over CDP.
Log in once, reuse session
Log in once into a keep-alive box, then have any later script reuse the session.
Retrieval
Structured data out of rendered pages.Catalog extraction
One
extract call, schema-validated typed output, screenshot provenance. AIAI-compiled scraper
AI compiles selectors once, then every later run scrapes deterministically. AI (first run only)
Crawl to dataset
Crawl a client-rendered docs section into chunked JSONL via
tab.content().Evidence pack
Full-page captures plus a hashed manifest, assembled in the box and downloaded as one archive.
Testing
The box as a test environment.Playwright migration
An existing Playwright test where only the launch line changes.
Test your own app
The box hosts the app under test and browses it on its own localhost.
Visual regression
Pixelmatch diffs against baselines stored on the box.