Config
Section titled “Config”Main class for a new Daytona::Config object.
Constructors
Section titled “Constructors”new Config()
Section titled “new Config()”def initialize(api_key: nil, jwt_token: nil, api_url: nil, organization_id: nil, target: nil, otel_enabled: nil, use_deprecated_polling: nil, _experimental: nil)Initializes a new Daytona::Config object.
Parameters:
api_keyString, nil - Daytona API key. Defaults to ENV[‘DAYTONA_API_KEY’].jwt_tokenString, nil - Daytona JWT token. Defaults to ENV[‘DAYTONA_JWT_TOKEN’].api_urlString, nil - Daytona API URL. Defaults to ENV[‘DAYTONA_API_URL’] or Daytona::Config::API_URL.organization_idString, nil - Daytona organization ID. Defaults to ENV[‘DAYTONA_ORGANIZATION_ID’].targetString, nil - Daytona target. Defaults to ENV[‘DAYTONA_TARGET’].otel_enabledBoolean, nil - Enable OpenTelemetry tracing for SDK operations.use_deprecated_pollingBoolean, nil - Observe sandbox state by legacy polling instead of WebSocket event streaming. Defaults to false (event streaming). Can also be enabled via the DAYTONA_USE_DEPRECATED_POLLING environment variable._experimentalHash, nil - Experimental configuration options.
Returns:
Config- a new instance of Config
Methods
Section titled “Methods”api_key()
Section titled “api_key()”def api_key()API key for authentication with the Daytona API
Returns:
String, nil- Daytona API key
api_key=()
Section titled “api_key=()”def api_key=(value)API key for authentication with the Daytona API
Returns:
String, nil- Daytona API key
jwt_token()
Section titled “jwt_token()”def jwt_token()JWT token for authentication with the Daytona API
Returns:
String, nil- Daytona JWT token
jwt_token=()
Section titled “jwt_token=()”def jwt_token=(value)JWT token for authentication with the Daytona API
Returns:
String, nil- Daytona JWT token
api_url()
Section titled “api_url()”def api_url()URL of the Daytona API
Returns:
String, nil- Daytona API URL
api_url=()
Section titled “api_url=()”def api_url=(value)URL of the Daytona API
Returns:
String, nil- Daytona API URL
organization_id()
Section titled “organization_id()”def organization_id()Organization ID for authentication with the Daytona API
Returns:
String, nil- Daytona API URL
organization_id=()
Section titled “organization_id=()”def organization_id=(value)Organization ID for authentication with the Daytona API
Returns:
String, nil- Daytona API URL
target()
Section titled “target()”def target()Target environment for sandboxes
Returns:
String, nil- Daytona target
target=()
Section titled “target=()”def target=(value)Target environment for sandboxes
Returns:
String, nil- Daytona target
otel_enabled()
Section titled “otel_enabled()”def otel_enabled()Enable OpenTelemetry tracing for SDK operations.
Returns:
Boolean, nil
otel_enabled=()
Section titled “otel_enabled=()”def otel_enabled=(value)Enable OpenTelemetry tracing for SDK operations.
Returns:
Boolean, nil
use_deprecated_polling()
Section titled “use_deprecated_polling()”def use_deprecated_polling()Observe sandbox state by legacy polling instead of WebSocket event streaming. Defaults to false (event streaming). Can also be enabled via the DAYTONA_USE_DEPRECATED_POLLING environment variable.
Returns:
Boolean
use_deprecated_polling=()
Section titled “use_deprecated_polling=()”def use_deprecated_polling=(value)Observe sandbox state by legacy polling instead of WebSocket event streaming. Defaults to false (event streaming). Can also be enabled via the DAYTONA_USE_DEPRECATED_POLLING environment variable.
Returns:
Boolean
_experimental()
Section titled “_experimental()”def _experimental()Experimental configuration options
Returns:
Hash, nil- Experimental configuration hash
_experimental=()
Section titled “_experimental=()”def _experimental=(value)Experimental configuration options
Returns:
Hash, nil- Experimental configuration hash
read_env()
Section titled “read_env()”def read_env(name)Reads a DAYTONA_-prefixed environment variable using the same precedence as the Config initializer: runtime ENV first, then .env.local, then .env. Only names starting with DAYTONA_ are accepted.
Parameters:
nameString - The environment variable name. Must start with DAYTONA_.
Returns:
String, nil- The value of the environment variable, or nil if not set.
Raises:
ArgumentError- If name does not start with DAYTONA_.