interface DaytonaSandboxOptionsConfiguration options for creating a Daytona Sandbox.
Auto-stop interval in minutes.
The sandbox will automatically stop after being idle for this duration. Set to 0 to disable auto-stop.
Custom environment variables to set in the sandbox.
These variables will be available to all commands and code executed in the sandbox.
Custom Docker image to use for the sandbox.
When specified, creates a sandbox from this image instead of the default snapshot. This is required when you want to customize resources.
Initial files to create in the sandbox after initialization.
A map of file paths to their contents. Files will be created in the sandbox filesystem before any commands are executed. Parent directories are created automatically.
Custom labels to attach to the sandbox.
Labels can be used for organizing and filtering sandboxes.
Primary language for code execution in the sandbox.
Determines the runtime environment and code execution tooling.
Resource allocation for the sandbox.
When specifying resources, you must also specify an image.
Resources cannot be customized when using the default snapshot-based sandbox.
Snapshot name to use for the sandbox.
When specified, creates a sandbox from this snapshot.
Cannot be used together with image.
Target region
Default timeout for command execution in seconds.
Authentication configuration for Daytona API.
# Get your API key from https://app.daytona.io
export DAYTONA_API_KEY=your_api_key_here
Or pass the API key directly in this auth configuration.
const options: DaytonaSandboxOptions = {
language: "typescript",
timeout: 300, // 5 minutes
target: "us",
};envVars: {
NODE_ENV: "development",
API_KEY: "secret"
}"node:20" or "python:3.12"const options: DaytonaSandboxOptions = {
language: "typescript",
initialFiles: {
"/app/index.js": "console.log('Hello')",
"/app/package.json": '{"name": "test"}',
},
};resources: { cpu: 2, memory: 4, disk: 20 }