| name | run-cloud-sandbox |
| description | Guide for creating and managing Run Cloud sandboxes using ComputeSDK. Use when building applications that need Run Cloud provider for ComputeSDK - fast Firecracker microVM sandboxes with snapshots and filesystem access. |
Run Cloud Sandboxes with ComputeSDK
Run Cloud provider for ComputeSDK - fast Firecracker microVM sandboxes with snapshots and filesystem access.
Setup
npm install computesdk @computesdk/run-cloud
Set your credentials:
RUN_CLOUD_API_KEY=your_run_cloud_api_key
RUN_CLOUD_API_TOKEN=your_run_cloud_api_token
RUN_CLOUD_API_URL=your_run_cloud_api_url
Quick Start
import { compute } from 'computesdk';
import { runCloud } from '@computesdk/run-cloud';
compute.setConfig({
provider: runCloud({
apiKey: process.env.RUN_CLOUD_API_KEY,
apiUrl: process.env.RUN_CLOUD_API_URL,
}),
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('echo "Hello from Run Cloud!"');
console.log(result.stdout);
await sandbox.destroy();
You can also call the provider factory directly:
import { runCloud } from '@computesdk/run-cloud';
const sdk = runCloud({
apiKey: process.env.RUN_CLOUD_API_KEY,
apiUrl: process.env.RUN_CLOUD_API_URL,
});
const sandbox = await sdk.sandbox.create();
Run Cloud Configuration
interface RunCloudConfig {
apiKey?: string;
apiUrl?: string;
fetch?: typeof fetch;
image?: string;
cpu?: number;
memory?: number;
disk?: number;
idlePauseSeconds?: number;
timeout?: number;
region?: string;
orgId?: string;
commandTimeout?: number;
tunnelTtlSeconds?: number;
}
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/.