
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@computesdk/codesandbox
Advanced tools
CodeSandbox provider for ComputeSDK - fast browser-compatible sandboxes with npm and Python support
CodeSandbox provider for ComputeSDK - Execute code in secure, isolated CodeSandbox environments with full filesystem and development environment support.
npm install @computesdk/codesandbox
export CSB_API_KEY=your_api_key_here
Use the gateway for zero-config auto-detection:
import { compute } from 'computesdk';
// Auto-detects CodeSandbox from CSB_API_KEY environment variable
const sandbox = await compute.sandbox.create();
// Execute JavaScript/Node.js code
const result = await sandbox.runCommand(`node - <<'JS'
const message = "Hello from CodeSandbox!";
console.log(message);
const data = { users: 3, tasks: 15 };
console.log(JSON.stringify(data, null, 2));
JS`);
console.log(result.stdout);
// Output:
// Hello from CodeSandbox!
// {
// "users": 3,
// "tasks": 15
// }
// Execute Python code
const pythonResult = await sandbox.runCommand(`python - <<'PY'
import json
data = {"framework": "CodeSandbox", "language": "Python"}
print(json.dumps(data, indent=2))
print(f"Running in: {data['framework']}")
PY`);
console.log(pythonResult.stdout);
// Output:
// {
// "framework": "CodeSandbox",
// "language": "Python"
// }
// Running in: CodeSandbox
await sandbox.destroy();
For direct SDK usage without the gateway:
import { codesandbox } from '@computesdk/codesandbox';
const compute = codesandbox({
apiKey: process.env.CSB_API_KEY,
templateId: 'universal', // Optional: specify template
timeout: 600000 // 10 minutes
});
const sandbox = await compute.sandbox.create();
const result = await sandbox.runCommand('node -e "console.log(\"Hello from CodeSandbox!\")"');
console.log(result.stdout);
await sandbox.destroy();
export CSB_API_KEY=your_api_key_here
interface CodesandboxConfig {
/** CodeSandbox API key - if not provided, will use CSB_API_KEY env var */
apiKey?: string;
/** Template to use for new sandboxes (defaults to universal template) */
templateId?: string;
/** Default runtime environment */
runtime?: 'python' | 'node';
/** Execution timeout in milliseconds */
timeout?: number;
}
// Execute Node.js code
const result = await sandbox.runCommand(`node - <<'JS'
const fs = require('fs');
const data = { timestamp: Date.now() };
console.log('Processing data:', JSON.stringify(data));
JS`);
// Execute Python code
const result = await sandbox.runCommand(`python - <<'PY'
import datetime
import json
data = {'timestamp': datetime.datetime.now().isoformat()}
print('Processing data:', json.dumps(data))
PY`);
// Auto-detection (based on code patterns)
const result = await sandbox.runCommand('python -c "print(\"Auto-detected as Python\")"');
// List files
const result = await sandbox.runCommand('ls', ['-la']);
// Install Node.js packages
const result = await sandbox.runCommand('npm', ['install', 'lodash']);
// Install Python packages
const result = await sandbox.runCommand('pip', ['install', 'requests']);
// Run development server
const result = await sandbox.runCommand('npm', ['run', 'dev']);
// Write file
await sandbox.filesystem.writeFile('/project/workspace/app.js', `
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.json({ message: 'Hello from CodeSandbox!' });
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
`);
// Read file
const content = await sandbox.filesystem.readFile('/project/workspace/package.json');
// Create directory
await sandbox.filesystem.mkdir('/project/workspace/src');
// List directory contents
const files = await sandbox.filesystem.readdir('/project/workspace');
// Check if file exists
const exists = await sandbox.filesystem.exists('/project/workspace/app.js');
// Remove file or directory
await sandbox.filesystem.remove('/project/workspace/temp.txt');
// Get sandbox info
const info = await sandbox.getInfo();
console.log(info.id, info.provider, info.status);
// Resume existing sandbox
const existing = await compute.sandbox.getById(provider, 'sandbox-id');
// Hibernate sandbox (saves state)
await compute.sandbox.destroy(provider, 'sandbox-id'); // Actually hibernates
// Note: CodeSandbox doesn't support listing all sandboxes
// Each sandbox is managed individually
/project/workspace/ directoryMIT
FAQs
CodeSandbox provider for ComputeSDK - fast browser-compatible sandboxes with npm and Python support
The npm package @computesdk/codesandbox receives a total of 727 weekly downloads. As such, @computesdk/codesandbox popularity was classified as not popular.
We found that @computesdk/codesandbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.