E2BRuntime connects to a live E2B sandbox by id. Create
it with E2B’s CLI or SDK. Programs accessing Mirage mounts as ordinary files
require Mirage and FUSE inside the sandbox, with mounts at the same paths
as the host workspace. Sandbox creation and cleanup remain with your application.
See the Sandbox overview for the shared image and
matching mount-prefix setup. The in-sandbox mount is served by the Python
Mirage build for both SDKs.
Install
Configure
apiKey is optional in Node when E2B_API_KEY is set. The runtime connects on the
first captured line and reuses the sandbox client until the workspace closes.
Closing the workspace leaves the sandbox running.
The same configuration in application code is:
mirage-core, with
independent stdin and output for concurrent commands.
For browsers, import the runtime explicitly and pass apiKey:
e2b for workspace configuration. Keep account keys
out of shared frontend bundles; use your backend to authenticate and authorize
access in a shared web app.
Use the native E2B SDK runtime for E2B commands. SSH remains useful for
general remote hosts and persistent MCP stdio connections.
Templates, CPU and memory sizing, networking, and lifecycle controls remain
E2B settings.