Sandbox0
Installation & Setup
npm install computesdk @computesdk/sandbox0export SANDBOX0_TOKEN=your_sandbox0_tokenUsage
import { compute } from 'computesdk';
import { sandbox0 } from '@computesdk/sandbox0';
compute.setConfig({
provider: sandbox0({
token: process.env.SANDBOX0_TOKEN,
hardTtl: 600,
}),
});
const sandbox = await compute.sandbox.create({
templateId: 'coding-agent',
memory: 256,
});
const result = await sandbox.runCommand('node --version');
console.log(result.stdout);
await sandbox.filesystem.writeFile('/tmp/result.txt', result.stdout);
console.log(await sandbox.filesystem.readFile('/tmp/result.txt'));
await sandbox.destroy();Configuration Options
Supported Operations
Method
Supported
Notes
Last updated
Was this helpful?