import 'dotenv/config';
import { Sandbox } from '@e2b/code-interpreter';
export default defineComponent({
props: {
e2b: {
type: "app",
app: "e2b",
}
},
async run({steps, $}) {
const sbx = await Sandbox.create({
apiKey: this.e2b.$auth.api_key
}); // By default the sandbox is alive for 5 minutes
return await sbx.runCode('print("hello world")'); // Execute Python inside the sandbox
},
})
Run or interpret code using the E2B service. See the documentation
E2B uses API keys for authentication. When you connect your E2B account, Pipedream securely stores the keys so you can easily authenticate to E2B APIs in both code and no-code steps.