API Reference
Sandboxes
Create normalized sandboxes and access their shared surface.
Creating a sandbox
const sandbox = await createSandbox({
provider,
cwd: "/workspace",
env: { NODE_ENV: "development" },
timeout: 300_000,
signal: abortController.signal,
});| Option | Type | Default | Behavior |
|---|---|---|---|
provider | SandboxProvider | Required | Adapter used to create the runtime. |
cwd | string | /workspace | Absolute working directory for normalized paths and commands. |
env | Record<string, string> | {} | Environment variables passed during creation. |
timeout | number | Provider default | Creation timeout in milliseconds. |
signal | AbortSignal | None | Cancels creation when supported by the provider. |
cwd must be absolute and cannot contain a null byte.
Sandbox properties
| Property | Type | Description |
|---|---|---|
id | string | Provider or adapter identifier for this sandbox. |
provider | ProviderName | local, e2b, daytona, vercel, or upstash. |
cwd | string | Normalized working directory. |
capabilities | CapabilityMap | Supported operations and their modes. |
raw | Provider-native type | Typed access to the underlying provider SDK object. |
Stopping a sandbox
await sandbox.stop();
await sandbox.stop(); // safe: stop is idempotent