Development
sandbox
Sandbox and testing environment
sandbox
Isolated sandbox environment for testing code, workflows, and integrations safely without affecting production systems.
Overview
The sandbox primitive provides secure, isolated environments for development and testing, with full platform access but separate data and state from production.
Quick Example
import { sandbox } from 'sdk.do'
// Create sandbox
const env = await sandbox.create({
name: 'test-environment',
config: {
database: 'test-db',
apiKeys: { /* test keys */ }
}
})
// Run code in sandbox
const result = await env.execute(async () => {
// This runs in isolated environment
const order = await db.create('orders', { ... })
await processPayment(order)
return order
})
// Inspect results without affecting production
console.log(result)
// Clean up
await env.destroy()Core Capabilities
- Isolated Execution - Run code without affecting production
- State Management - Separate databases and state for testing
- Resource Limits - CPU, memory, and time limits for safety
- Snapshot & Restore - Save and restore environment state
- Integration Testing - Test external integrations safely
Access Methods
SDK
TypeScript/JavaScript library for sandbox management
await sandbox.create({ name: 'test-env', config: { database: 'test-db' } })CLI
Command-line tool for sandbox operations
do sandbox create test-env --database test-dbAPI
REST/RPC endpoints for sandbox management
curl -X POST https://api.do/v1/sandbox -d '{"name":"test-env","config":{...}}'MCP
Model Context Protocol for AI-driven testing
Create a sandbox environment named "test-env" with test database