apps/docs/src/content/docs/en/java-sdk/config.mdx
Configuration used to initialize a Daytona client.
Contains API authentication settings, API endpoint URL, and the default target region used when creating new Sandboxes.
public String getApiKey()
Returns the API key used to authenticate SDK requests.
Returns:
String - API key configured for the clientpublic String getApiUrl()
Returns the Daytona API base URL.
Returns:
String - API URL used for main API requestspublic String getTarget()
Returns the default target location for newly created Sandboxes.
Returns:
String - target region identifier, or null if not configuredpublic 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 - true if OpenTelemetry tracing is enabledBuilder for creating immutable DaytonaConfig instances.
public Builder apiKey(String apiKey)
Sets the API key used for authenticating SDK requests.
Parameters:
apiKey String - Daytona API keyReturns:
Builder - this builder instancepublic Builder apiUrl(String apiUrl)
Sets the Daytona API base URL.
Parameters:
apiUrl String - API URL to use; defaults to https://app.daytona.io/api when omittedReturns:
Builder - this builder instancepublic Builder target(String target)
Sets the default target region for new Sandboxes.
Parameters:
target String - target location identifierReturns:
Builder - this builder instancepublic 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:
otelEnabled boolean - whether to enable OpenTelemetry tracingReturns:
Builder - this builder instancepublic DaytonaConfig build()
Builds a new immutable DaytonaConfig.
Returns:
DaytonaConfig - configured DaytonaConfig instance