Skip to main content

Java Server SDK Getting Started

Maven GitHub

To use the DevCycle Java SDK, initialize a client object.

import com.devcycle.sdk.server.local.api.DevCycleLocalClient;

public class MyClass {

private DevCycleLocalClient client;

public MyClass() {
client = new DevCycleLocalClient(System.getenv("DEVCYCLE_SERVER_SDK_KEY"));
}
}

NOTE: use DevCycleCloudClient for Cloud Bucketing mode.

Initialization Options

The SDK exposes various initialization options which can be set when initializing the DevCycle client:

import com.devcycle.sdk.server.local.api.DevCycleLocalClient;
import com.devcycle.sdk.server.local.model.DevCycleLocalOptions;

public class MyClass {

private DevCycleLocalClient client;

public MyClass() {
DevCycleLocalOptions options = DevCycleLocalOptions.builder()
// Insert Options
.build();

client = new DevCycleLocalClient(System.getenv("DEVCYCLE_SERVER_SDK_KEY"), options);
}
}

NOTE: use DevCycleCloudOptions \ DevCycleCloudClient for Cloud Bucketing mode.

Local Bucketing Options

DevCycle OptionTypeDescription
customLoggerIDevCycleLoggerLogger override to replace default logger
restOptionsIRestOptionsContact support for usage instructions.
configPollingIntervalMSintControls the polling interval in milliseconds to fetch new environment config changes, defaults to 30 seconds, minimum value is 1 second.
configPollingTimeoutMsintControls the request timeout to fetch new environment config changes, defaults to 10 seconds, must be less than the configPollingIntervalMS value, minimum value is 1 second.
eventFlushIntervalMSintControls the interval between flushing events to the DevCycle servers, defaults to 10 seconds.
flushEventQueueSizeintControls the maximum size the event queue can grow to until a flush is forced. Defaults to 1000.
maxEventQueueSizeintControls the maximum size the event queue can grow to until events are dropped. Defaults to 2000.
eventRequestChunkSizeintCount of events to chunk per event upload request. Defaults to 100.
disableAutomaticEventLoggingbooleanDisables logging of sdk generated events (e.g. aggVariableEvaluated, aggVariableDefaulted) to DevCycle.
disableCustomEventLoggingbooleanDisables logging of custom events, from track() method, and user data to DevCycle.
configCdnBaseUrlStringContact support for usage instructions.
eventsApiBaseUrlStringContact support for usage instructions.
enableBetaRealtimeUpdatesbooleanEnables the usage of Beta Realtime Updates for DevCycle. This feature is currently in beta.

Cloud Bucketing Options

DevCycle OptionTypeDescription
customLoggerIDevCycleLoggerLogger override to replace default logger
restOptionsIRestOptionsContact support for usage instructions
enableEdgeDBBooleanEnables the usage of EdgeDB for DevCycle that syncs User Data to DevCycle.
NOTE: This is only available with Cloud Bucketing enabled.
baseUrlOverrideStringContact support for usage instructions.