You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the LDClient configuration to use a defined Relay Proxy.
Before:
importcom.launchdarkly.sdk.LDContext;
importcom.launchdarkly.sdk.server.LDClient;
classTest {
publicvoida() {
LDClientclient = newLDClient("sdk-key");
LDContextcontext = LDContext.builder("context-key")
.name("user")
.build();
booleanflagValue = client.boolVariation("flag-key-123abc", context, false);
if (flagValue) {
// Application code to show the feature
} else {
// The code to run if the feature is off
}
}
}
After (5.9 or later):
importcom.launchdarkly.sdk.LDContext;
importcom.launchdarkly.sdk.server.LDClient;
classTest {
publicvoida() {
LDClientclient = newLDClient("sdk-key", newLDConfig.Builder()
.serviceEndpoints(Components.serviceEndpoints()
.relayProxy("https://your-relay-proxy.com:8030"))
.build());
LDContextcontext = LDContext.builder("context-key")
.name("user")
.build();
booleanflagValue = client.boolVariation("flag-key-123abc", context, false);
if (flagValue) {
// Application code to show the feature
} else {
// The code to run if the feature is off
}
}
}
After (5.8 or earlier):
importcom.launchdarkly.sdk.LDContext;
importcom.launchdarkly.sdk.server.LDClient;
classTest {
publicvoida() {
LDClientclient = newLDClient("sdk-key", LDConfig.Builder()
.dataSource(Components.streamingDataSource()
.baseURI(URI.create("https://your-relay-proxy.com:8030"))
.events(Components.sendEvents()
.baseURI(URI.create("https://your-relay-proxy.com:8030"))
.build());
LDContextcontext = LDContext.builder("context-key")
.name("user")
.build();
booleanflagValue = client.boolVariation("flag-key-123abc", context, false);
if (flagValue) {
// Application code to show the feature
} else {
// The code to run if the feature is off
}
}
}
The text was updated successfully, but these errors were encountered:
Update the
LDClient
configuration to use a defined Relay Proxy.Before:
After (5.9 or later):
After (5.8 or earlier):
The text was updated successfully, but these errors were encountered: