| name | blaxel-sandbox |
| description | Guide for creating and managing Blaxel sandboxes using ComputeSDK. Use when building applications that need Blaxel provider for ComputeSDK - lightweight cloud sandboxes for code execution. |
Blaxel Sandboxes with ComputeSDK
Blaxel provider for ComputeSDK - lightweight cloud sandboxes for code execution.
Setup
npm install computesdk @computesdk/blaxel
Set your credentials:
BL_API_KEY=your_bl_api_key
BL_WORKSPACE=your_bl_workspace
Quick Start
import { compute } from 'computesdk';
import { blaxel } from '@computesdk/blaxel';
compute.setConfig({
provider: blaxel({
apiKey: process.env.BL_API_KEY,
workspace: process.env.BL_WORKSPACE,
}),
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('echo "Hello from Blaxel!"');
console.log(result.stdout);
await sandbox.destroy();
You can also call the provider factory directly:
import { blaxel } from '@computesdk/blaxel';
const sdk = blaxel({
apiKey: process.env.BL_API_KEY,
workspace: process.env.BL_WORKSPACE,
});
const sandbox = await sdk.sandbox.create();
Blaxel Configuration
interface BlaxelConfig {
workspace?: string;
apiKey?: string;
image?: string;
region?: string;
memory?: number | 4096;
ports?: number[] | [3000];
}
Full API
ComputeSDK exposes the same universal sandbox API across providers: sandbox.create(), sandbox.getById(), sandbox.destroy(), sandbox.runCommand(), sandbox.getInfo(), sandbox.getUrl(), and sandbox.filesystem.*.
Install the main skill for the complete reference:
npx skills add https://github.com/computesdk/sandbox-skills --skill computesdk
Or see https://www.computesdk.com/docs/reference/sandbox/.