Configuration
The Daytona SDK provides flexible configuration options to customize its behavior and connection settings.
Configuration Options
Python Configuration
Daytona SDK provides an option to configure settings using the DaytonaConfig
class. The DaytonaConfig
class accepts the following parameters:
api_key
: Your Daytona API keyserver_url
: URL of your Daytona servertarget
: Daytona Target to create the Workspaces on.
TypeScript Configuration
Daytona SDK provides an option to configure settings using the DaytonaConfig
interface. The DaytonaConfig
interface includes these properties:
apiKey
: Your Daytona API key.serverUrl
: URL of your Daytona server.target
: Daytona Target to create the Workspaces on.timeout
: Request timeout in milliseconds.verifySsl
: Enable SSL verification.
Environment Variables
Daytona SDK supports environment variables for configuration. The SDK automatically looks for these environment variables:
Variable | Description | Default |
---|---|---|
DAYTONA_API_KEY | Your Daytona API key. | None |
DAYTONA_SERVER_URL | URL of your Daytona server. | None |
DAYTONA_TARGET | Daytona Target to create the Workspaces on. | ”local” |
Setting Environment Variables
Daytona SDK can read configuration from environment variables. You can set these environment variables using the following methods:
Using a .env
File
Create a .env
file in your project root directory:
DAYTONA_API_KEY
: Your Daytona API key.DAYTONA_SERVER_URL
: URL of your Daytona server.DAYTONA_TARGET
: Daytona Target to create the Workspaces on.
Using Shell Environment
Set environment variables in your shell:
Configuration Precedence
The SDK uses the following precedence order for configuration (highest to lowest):
- Explicitly passed configuration in code.
- Environment variables.
- Configuration file.
- Default values.