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 (run, act, extract) and need a model provider key on the box
or account. Everything else runs with the Box key alone.Agents
Goal-driven browsing withtab.run().
Search with fallback
Constrained search with a fallback category. The agent evaluates results, rejects with reasons, and switches on its own. AI
Playwright vs act vs run
The same task via Playwright,
act plus extract, and run. Pick your autonomy level by token cost. AIObserve, record, audit
The search again with live view, session recording, a decision log, and token accounting. AI
Multisite feed
One prompt and one schema across three differently structured sites. AI
Automation
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.
AI smoke tests
Agent-driven smoke flow, cross-checked by deterministic DOM assertions, recorded on video. AI
Visual regression
Pixelmatch diffs against baselines stored on the box.