namespace-sandbox
Namespace Sandboxes with ComputeSDK
Run code on Namespace's cloud container instances through ComputeSDK's unified API. Namespace provides ephemeral containers with customizable CPU and memory allocation — ideal when you need control over compute resources, specific architectures, or lightweight isolated environments.
Setup
npm install computesdk
# .env
COMPUTESDK_API_KEY=your_computesdk_api_key
NSC_TOKEN=your_namespace_nsc_token
Get your ComputeSDK key at https://console.computesdk.com/register
Quick Start
import { compute } from 'computesdk';
// Auto-detects Namespace from environment variables
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCode('print("Hello from Namespace!")');
console.log(result.output);
await sandbox.destroy();
Explicit Configuration
For multi-provider setups or when you want to be explicit:
import { compute } from 'computesdk';
compute.setConfig({
computesdkApiKey: process.env.COMPUTESDK_API_KEY,
provider: 'namespace',
namespace: {
token: process.env.NSC_TOKEN,
}
});
const sandbox = await compute.sandbox.create();
Custom Resources
Namespace lets you customize the compute resources for your sandboxes:
compute.setConfig({
computesdkApiKey: process.env.COMPUTESDK_API_KEY,
provider: 'namespace',
namespace: {
token: process.env.NSC_TOKEN,
virtualCpu: 4,
memoryMegabytes: 8192,
}
});
Namespace Configuration Options
interface NamespaceConfig {
token?: string; // Uses NSC_TOKEN env var if not set
virtualCpu?: number; // CPU cores (default: 2)
memoryMegabytes?: number; // RAM in MB (default: 4096)
machineArch?: string; // Architecture (default: 'amd64')
os?: string; // Operating system (default: 'linux')
}
Full API
ComputeSDK provides the same API across all providers: filesystem operations, shell commands, managed servers, overlays, terminals, and client access.
Install the main skill for the complete reference:
npx skills add https://github.com/computesdk/sandbox-skills --skill computesdk
More from computesdk/sandbox-skills
e2b-sandbox
Guide for creating and managing E2B sandboxes using ComputeSDK. Use when building applications that need E2B Firecracker microVM sandboxes for secure code execution, AI code runners, or isolated development environments on E2B.
57computesdk
Guide for building sandbox applications with ComputeSDK, a unified TypeScript SDK for running untrusted code in sandboxed environments across multiple compute providers (E2B, Daytona, Vercel, Modal, Railway, Namespace, Render). Use this skill when implementing sandboxed code execution, creating isolated development environments, running LLM-generated code safely, building app builders, or integrating dynamic code execution into applications.
11daytona-sandbox
Guide for creating and managing Daytona sandboxes using ComputeSDK. Use when building applications that need Daytona development workspace environments for code execution, full-featured dev environments, or isolated coding workspaces.
10vercel-sandbox
Guide for creating and managing Vercel sandboxes using ComputeSDK. Use when building applications that need Vercel's globally distributed serverless sandbox environments for code execution with Node.js or Python runtimes.
6railway-sandbox
Guide for creating and managing Railway sandboxes using ComputeSDK. Use when building applications that need self-hosted sandbox environments on Railway's infrastructure for code execution, containerized development, or persistent services.
5render-sandbox
Guide for creating and managing Render sandboxes using ComputeSDK. Use when building applications that need self-hosted sandbox environments on Render's cloud platform for code execution with zero infrastructure setup.
4