Run the same TypeScript sandbox code on Local, E2B, Daytona, Vercel Sandbox, Upstash Box, Ascii Box, or Railway Sandboxes.
bun add @opencoredev/sandbox-sdkNode.js 22 or 24 is supported. Bun 1.3 or newer is also supported.
import { createSandbox } from "@opencoredev/sandbox-sdk";
import { local } from "@opencoredev/sandbox-sdk/local";
await using sandbox = await createSandbox({ provider: local() });
console.log((await sandbox.run("node --version")).stdout);await using stops the sandbox automatically when its scope exits, including when an operation throws.
Node.js 24 and Bun run this syntax directly. On Node.js 22, compile TypeScript to ES2022 or use the callback-style withSandbox() helper.
| Provider | Runtime | Best for |
|---|---|---|
| Local | AgentOS VM | Development, CI, and self-hosting |
| E2B | Hosted Linux sandbox | Coding agents and isolated jobs |
| Daytona | Cloud workspace | Persistent projects and GPUs |
| Vercel Sandbox | Hosted Linux sandbox | Coding agents and persistent workspaces |
| Upstash Box | Durable cloud container | Serverless agents and long-lived state |
| Ascii Box | Persistent cloud VM | Full VMs and protected app previews |
| Railway | Ephemeral cloud VM | Durable jobs and private networking |
Local is included. Cloud providers use their official SDKs and credentials.
Setup, usage, integrations, and API reference are available at sandbox-sdk.app/docs.
Maintainer release instructions are in RELEASING.md.
MIT © OpenCore
