examples/

directory
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0

Directories

Path Synopsis
Basic example: create a sandbox, run a command, read its output.
Basic example: create a sandbox, run a command, read its output.
Desktop example: build the local e2b.Dockerfile as a template, launch a sandbox, print the noVNC URL, then prove that SDK PTY sessions are mirrored into the shared tmux that the VNC desktop shows.
Desktop example: build the local e2b.Dockerfile as a template, launch a sandbox, print the noVNC URL, then prove that SDK PTY sessions are mirrored into the shared tmux that the VNC desktop shows.
Lifecycle example (E2B Cloud): list templates, build a new one via POST /v3/templates, inspect it, spawn a sandbox via POST /v2/sandboxes, read sandbox info, then tear everything down.
Lifecycle example (E2B Cloud): list templates, build a new one via POST /v3/templates, inspect it, spawn a sandbox via POST /v2/sandboxes, read sandbox info, then tear everything down.
Lifecycle example for self-hosted E2B control planes (required on runtime < 2025.44 and still actively served across all self-hosted runtime <= 2026.30; note that POST /v2/templates is retired with 410 Gone on E2B Cloud, whereas ListV1, SetPublicV1, and CreateV1 are soft-deprecated in OpenAPI and remain served on both self-hosted and E2B Cloud).
Lifecycle example for self-hosted E2B control planes (required on runtime < 2025.44 and still actively served across all self-hosted runtime <= 2026.30; note that POST /v2/templates is retired with 410 Gone on E2B Cloud, whereas ListV1, SetPublicV1, and CreateV1 are soft-deprecated in OpenAPI and remain served on both self-hosted and E2B Cloud).
Self-hosted example: point the SDK at a self-hosted E2B control plane (runtime <= 2026.30, including pre-2025.31 deployments) and inspect the sandbox session (ID, template, state, timing, envd info, live metrics).
Self-hosted example: point the SDK at a self-hosted E2B control plane (runtime <= 2026.30, including pre-2025.31 deployments) and inspect the sandbox session (ID, template, state, timing, envd info, live metrics).
Template example: build a simple Debian-based template and launch a sandbox from it.
Template example: build a simple Debian-based template and launch a sandbox from it.
Interactive terminal example: open an E2B sandbox, attach the local TTY to a remote PTY (bash) in raw mode, and close the sandbox when the user exits.
Interactive terminal example: open an E2B sandbox, attach the local TTY to a remote PTY (bash) in raw mode, and close the sandbox when the user exits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL