E2B provides Firecracker microVMs — full Linux sandboxes with sub-second cold starts (in the same region), persistent disk during their lifetime, and built-in Python and Node.js support. They’re designed for fast, ephemeral code execution.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/withastro/flue/llms.txt
Use this file to discover all available pages before exploring further.
Install the connector
Runflue add e2b and pipe it to your coding agent. The agent reads the connector instructions and writes .flue/connectors/e2b.ts into your project.
e2b if it isn’t already in your package.json.
Set up your API key
You needE2B_API_KEY at runtime. Get one from the E2B dashboard. Add it to your .env file, CI secrets, or equivalent:
e2b SDK reads E2B_API_KEY from the environment automatically — you don’t pass it explicitly when creating a sandbox.
Pass the file to Flue’s dev server or run command:
Basic usage
After the connector is installed, create an E2B sandbox and pass it toinit():
Custom templates
E2B supports custom templates — pre-built snapshots with your tools already installed. If you run many short-lived agents against the same prepared environment, a custom template avoids reinstalling tooling on every cold start:Code interpreter variant
If you’re building a Jupyter-style code interpreter agent, E2B also publishes@e2b/code-interpreter, which re-exports the same Sandbox class with extra runCode methods. The connector works with it too — install @e2b/code-interpreter instead of e2b and adjust the import in the connector file:
When to use E2B
E2B works from any Flue deployment target — Node.js, Cloudflare, GitHub Actions. It’s the right choice when your agent needs:- Fast ephemeral sandboxes with sub-second cold starts
- Python or Node.js environments without complex setup
- Short-lived code execution without persistent state across requests