Package Exports
- @cloudbase/e2b
- @cloudbase/e2b/dist/index.js
- @cloudbase/e2b/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cloudbase/e2b) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
What is E2B?
E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.
Run your first Sandbox
1. Install SDK
npm i e2b2. Get your E2B API key
E2B_API_KEY=e2b_***3. Start a sandbox and run commands
import Sandbox from 'e2b'
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B!"')
console.log(result.stdout) // Hello from E2B!4. Code execution with Code Interpreter
If you need runCode(), install the Code Interpreter SDK:
npm i @e2b/code-interpreterimport { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
const execution = await sandbox.runCode('x = 1; x += 1; x')
console.log(execution.text) // outputs 25. Check docs
Visit E2B documentation.
6. E2B cookbook
Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.