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.
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). Agent
A live observe then act(action) then extract loop you own, with extract as the stop check. AI
Automation#
Forms, files, and durable sessions.
Script the deterministic steps, delegate the judgment call to a single act, and assert the result.
A download lands on the box filesystem and is processed in place.
Upload a box-generated file through a real form over CDP.
Log in once into a keep-alive box, then have any later script reuse the session.
Retrieval#
Structured data out of rendered pages.
One extract call, schema-validated typed output, screenshot provenance. AI
AI compiles selectors once, then every later run scrapes deterministically. AI (first run only)
Crawl a client-rendered docs section into chunked JSONL via tab.content().
Full-page captures plus a hashed manifest, assembled in the box and downloaded as one archive.
Testing#
The box as a test environment.