Back to Daytona

DaytonaConfig

apps/docs/src/content/docs/en/java-sdk/config.mdx

0.173.02.6 KB
Original Source

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

getApiKey()

java
public String getApiKey()

Returns the API key used to authenticate SDK requests.

Returns:

  • String - API key configured for the client

getApiUrl()

java
public String getApiUrl()

Returns the Daytona API base URL.

Returns:

  • String - API URL used for main API requests

getTarget()

java
public String getTarget()

Returns the default target location for newly created Sandboxes.

Returns:

  • String - target region identifier, or null if not configured

isOtelEnabled()

java
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 - true if OpenTelemetry tracing is enabled

DaytonaConfig.Builder

Builder for creating immutable DaytonaConfig instances.

Methods

apiKey()

java
public Builder apiKey(String apiKey)

Sets the API key used for authenticating SDK requests.

Parameters:

  • apiKey String - Daytona API key

Returns:

  • Builder - this builder instance

apiUrl()

java
public 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 omitted

Returns:

  • Builder - this builder instance

target()

java
public Builder target(String target)

Sets the default target region for new Sandboxes.

Parameters:

  • target String - target location identifier

Returns:

  • Builder - this builder instance

otelEnabled()

java
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:

  • otelEnabled boolean - whether to enable OpenTelemetry tracing

Returns:

  • Builder - this builder instance

build()

java
public DaytonaConfig build()

Builds a new immutable DaytonaConfig.

Returns:

  • DaytonaConfig - configured DaytonaConfig instance