Skip to main content
Reference vendor/cloudflare 2 min read

api-quick-ref

Sandbox @next API documentation

Use this reference after the sandbox-next package-line gate. Existing stable apps use sandbox-stable; stable-to-preview migrations use sandbox-migrate-to-next.

Fetch the page for the task before implementing and check signatures against installed @cloudflare/sandbox@next types.

TaskDocumentation
Launch commands, collect output, stream logs, wait for readiness, inspect or stop processesProcesses API and Process execution
Understand sandbox IDs, container lifetime, sleep, destruction, and durable stateSandbox lifecycle
Configure sleep, keep-alive, and ID normalizationSandbox options; omit removed session and transport fields on @next.
Create, connect, write to, resize, or stop interactive terminalsTerminals API and Terminals
Attach the interpreter, manage contexts, run code, or consume streamed resultsInterpreter and Interpreter API
Set sandbox or per-launch environmentEnvironment variables
Keep external API credentials in the WorkerOutbound traffic
Handle startup failures, interrupted work, stale handles, or local wait cancellationErrors and recovery and Errors API
Find other preview APIsPreview API reference

For files, mounts, backups, ports, and tunnels, follow the shared-surface links in the preview overview. Use main-docs signatures only where that overview says they still apply; ignore stable-only session and transport options.