DaytonaConfig
Section titled “DaytonaConfig”Configuration used to initialize a Daytona client.
Contains API authentication settings, API endpoint URL, and the default target region used when creating new Sandboxes.
Methods
Section titled “Methods”getApiKey()
Section titled “getApiKey()”public String getApiKey()Returns the API key used to authenticate SDK requests.
Returns:
String- API key configured for the client
getApiUrl()
Section titled “getApiUrl()”public String getApiUrl()Returns the Daytona API base URL.
Returns:
String- API URL used for main API requests
getTarget()
Section titled “getTarget()”public String getTarget()Returns the default target location for newly created Sandboxes.
Returns:
String- target region identifier, ornullif not configured
isOtelEnabled()
Section titled “isOtelEnabled()”public boolean isOtelEnabled()Returns whether OpenTelemetry tracing is enabled for SDK operations.
Note: SDK-side OpenTelemetry instrumentation is not yet implemented in the Java SDK. This setter exists for API parity with the other SDKs and to allow code to opt in ahead of instrumentation landing in a future release.
Returns:
boolean-trueif OpenTelemetry tracing is enabled
isUseDeprecatedPolling()
Section titled “isUseDeprecatedPolling()”public boolean isUseDeprecatedPolling()Returns whether legacy polling mode is enabled instead of WebSocket event streaming.
Deprecated: Polling-only mode will be removed in a future release; event streaming is the default and falls back to polling automatically when WebSockets are unavailable.
Returns:
boolean-trueif deprecated polling mode is active
DaytonaConfig.Builder
Section titled “DaytonaConfig.Builder”Builder for creating immutable DaytonaConfig instances.
Methods
Section titled “Methods”apiKey()
Section titled “apiKey()”public Builder apiKey(String apiKey)Sets the API key used for authenticating SDK requests.
Parameters:
apiKeyString - Daytona API key
Returns:
Builder- this builder instance
apiUrl()
Section titled “apiUrl()”public Builder apiUrl(String apiUrl)Sets the Daytona API base URL.
Parameters:
apiUrlString - API URL to use; defaults tohttps://app.daytona.io/apiwhen omitted
Returns:
Builder- this builder instance
target()
Section titled “target()”public Builder target(String target)Sets the default target region for new Sandboxes.
Parameters:
targetString - target location identifier
Returns:
Builder- this builder instance
otelEnabled()
Section titled “otelEnabled()”public Builder otelEnabled(boolean otelEnabled)Enables OpenTelemetry tracing for SDK operations.
Note: SDK-side OpenTelemetry instrumentation is not yet implemented in the Java SDK. This setter exists for API parity with the other SDKs and to allow code to opt in ahead of instrumentation landing in a future release.
Parameters:
otelEnabledboolean - whether to enable OpenTelemetry tracing
Returns:
Builder- this builder instance
useDeprecatedPolling()
Section titled “useDeprecatedPolling()”public Builder useDeprecatedPolling(boolean useDeprecatedPolling)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.
Deprecated: Polling-only mode will be removed in a future release; event streaming is the default and falls back to polling automatically when WebSockets are unavailable.
Parameters:
useDeprecatedPollingboolean - whether to use legacy polling
Returns:
Builder- this builder instance
build()
Section titled “build()”public DaytonaConfig build()Builds a new immutable DaytonaConfig.
Returns:
DaytonaConfig- configuredDaytonaConfiginstance