| name | namespace-sandbox |
| description | Guide for creating and managing Namespace sandboxes using ComputeSDK. Use when building applications that need Namespace provider for ComputeSDK - cloud-native sandboxes with optional GPU support. |
Namespace Sandboxes with ComputeSDK
Namespace provider for ComputeSDK - cloud-native sandboxes with optional GPU support.
Setup
npm install computesdk @computesdk/namespace
Set your credentials:
NSC_TOKEN=your_nsc_token
NSC_TOKEN_FILE=your_nsc_token_file
Quick Start
import { compute } from 'computesdk';
import { namespace } from '@computesdk/namespace';
compute.setConfig({
provider: namespace({
token: process.env.NSC_TOKEN,
tokenFile: process.env.NSC_TOKEN_FILE,
}),
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('echo "Hello from Namespace!"');
console.log(result.stdout);
await sandbox.destroy();
You can also call the provider factory directly:
import { namespace } from '@computesdk/namespace';
const sdk = namespace({
token: process.env.NSC_TOKEN,
tokenFile: process.env.NSC_TOKEN_FILE,
});
const sandbox = await sdk.sandbox.create();
Namespace Configuration
interface NamespaceConfig {
token?: string;
tokenFile?: string;
virtualCpu?: number;
memoryMegabytes?: number;
machineArch?: string;
os?: string;
documentedPurpose?: string;
destroyReason?: string;
targetContainerName?: string;
}
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/.