Skip to main content

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Client-side SDKs

This feature is available in the following client-side SDKs:

.NET (client-side)

To configure an alternate service endpoint for the SDK, use the ServiceEndpoints builder method to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      var config = Configuration
          .Builder("example-mobile-key", ConfigurationBuilder.AutoEnvAttributes.Enabled)
          .ServiceEndpoints(Components.ServiceEndpoints()
            .RelayProxy("https://your-relay-proxy.com:8030"))
          .Build();

Android

To configure an alternate service endpoint for the SDK, use the streamUri, pollUri, and eventsUri builder methods to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled)
        .mobileKey("example-mobile-key")
        .serviceEndpoints(
          Components.serviceEndpoints()
            .relayProxy("https://your-relay-proxy.com:8030")
        )
        .build();

C++ (client-side)

To configure an alternate service endpoint for the SDK, use StreamingBaseUrl, PollingBaseUrl, and EventsBaseUrl to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      auto config_builder = client_side::ConfigBuilder("example-mobile-key");
      config_builder.ServiceEndpoints()
          .StreamingBaseUrl("https://your-relay-proxy.com:8030")
          .PollingBaseUrl("https://your-relay-proxy.com:8030")
          .EventsBaseUrl("https://your-relay-proxy.com:8030")
      auto config = config_builder.Build();
To learn more, read ServiceEndpoints.

Electron

To configure an alternate service endpoint for the SDK, use the streamUrl, baseUrl, and eventsUrl options to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      const options = {
        streamUrl: 'https://your-relay-proxy.com:8030',
        baseUrl: 'https://your-relay-proxy.com:8030',
        eventsUrl: 'https://your-relay-proxy.com:8030'
      };
The Electron SDK uses the baseUrl for the initial connection and subsequent identify calls.If you have enabled streaming, the SDK uses the streamUrl for subsequent connections. If you have enabled useReport, these subsequent requests will use the REPORT HTTP request method. These REPORT requests are streaming requests only if you have installed the LaunchDarkly EventSource polyfill to provide streaming support. Otherwise, these requests will be standard REPORT http requests. To learn more, read EventSource under Requirements and polyfills.

Flutter

To configure an alternate service endpoint for the SDK, use the ServiceEndpoints configuration option to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      final config = LDConfig(
        CredentialSource.fromEnvironment(),
        autoEnvAttributes.enabled,
        serviceEndpoints: ServiceEndpoints.relayProxy('https://your-relay-proxy.com:8030')
      );
To learn more, read serviceEndpoints.

iOS

To configure an alternate service endpoint for the SDK, use the streamUrl, baseUrl, and eventsUrl properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      var ldConfig = LDConfig(mobileKey: "example-mobile-key", autoEnvAttributes: .enabled)
      ldConfig.streamUrl = URL(string: "https://your-relay-proxy.com:8030")
      ldConfig.baseUrl = URL(string: "https://your-relay-proxy.com:8030")
      ldConfig.eventsUrl = URL(string: "https://your-relay-proxy.com:8030")
If you are using LaunchDarkly iOS SDK version 9.9 or greater and you choose to enable compression of event payloads, you must upgrade Relay Proxy to version 8.9 or greater. To learn more, read enableCompression and Configuring an SDK to use the Relay Proxy.

Java

Script
To configure an alternate service endpoint for the SDK, use the streamUri, baseUri, and eventsUri properties to specify the base URIs. In previous versions of the JavaScript SDK, these properties were named streamUrl, baseUrl, and eventsUrl, respectively.Here are some examples for common base URIs that you might use instead of the defaults:
      const options = {
        streamUri: 'https://your-relay-proxy.com:8030',
        baseUri: 'https://your-relay-proxy.com:8030',
        eventsUri: 'https://your-relay-proxy.com:8030'
      };
The JavaScript SDK uses the baseUri for the initial connection and subsequent identify calls.If you have enabled streaming, the SDK uses the streamUri for subsequent connections. If you have enabled useReport, these subsequent requests will use the REPORT HTTP request method. These REPORT requests are streaming requests only if you have installed the LaunchDarkly EventSource polyfill to provide streaming support. Otherwise, these requests will be standard REPORT http requests. To learn more, read EventSource under Requirements and polyfills.

Node.js (client-side)

To configure an alternate service endpoint for the SDK, use the streamUrl, baseUrl, and eventsUrl properties to set the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      const options = {
        streamUrl: 'https://your-relay-proxy.com:8030',
        baseUrl: 'https://your-relay-proxy.com:8030',
        eventsUrl: 'https://your-relay-proxy.com:8030'
      };
The Node.js (client-side) SDK uses the baseUrl for the initial connection and subsequent identify calls.If you have enabled streaming, the SDK uses the streamUrl for subsequent connections. If you have enabled useReport, these subsequent requests will use the REPORT HTTP request method. These REPORT requests are streaming requests only if you have installed the LaunchDarkly EventSource polyfill to provide streaming support. Otherwise, these requests will be standard REPORT http requests. To learn more, read EventSource under Requirements and polyfills.

React Native

To configure an alternate service endpoint for the SDK, use the streamUri, baseUri, and eventsUri properties to set the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      import { LDOptions } from '@launchdarkly/react-native-client-sdk'

      let options: LDOptions = {
        streamUri: 'https://your-relay-proxy.com:8030',
        baseUri: 'https://your-relay-proxy.com:8030',
        eventsUri: 'https://your-relay-proxy.com:8030',
      };
In version 6.x and earlier, the config properties were named streamUri, pollUri, and eventsUri. They were renamed to streamUrl, pollUrl, and eventsUrl in version 7.
  1. In version 10.0, they are named streamUri, baseUri, and eventsUri. To learn more, read LDOptions.

React Web

To configure an alternate service endpoint for the SDK, use the streamUrl, baseUrl, and eventsUrl options to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
      const options = {
        baseUrl: 'https://your-relay-proxy.com:8030',
        streamUrl: 'https://your-relay-proxy.com:8030',
        eventsUrl: 'https://your-relay-proxy.com:8030'
      };
The React Web SDK uses the baseUrl for the initial connection and subsequent identify calls.If you have enabled streaming, the SDK uses the streamUrl for subsequent connections. If you have enabled useReport, these subsequent requests will use the REPORT HTTP request method. These REPORT requests are streaming requests only if you have installed the LaunchDarkly EventSource polyfill to provide streaming support. Otherwise, these requests will be standard REPORT http requests. To learn more, read EventSource under Requirements and polyfills.To learn more, read Configuration options in the React Web SDK reference.

Roku

To configure an alternate service endpoint for the SDK, use the setStreamURI, setAppURI, and setEventsURI methods to specify the base URIs:
      ' for a legacy Roku application
      config = LaunchDarklyConfig("example-mobile-key")

      ' for a SceneGraph Roku Application
      config = LaunchDarklyConfig("example-mobile-key", CLIENT_SCENEGRAPH_NODE)

      config.setStreamURI("https://your-relay-proxy.com:8030")
      config.setAppURI("https://your-relay-proxy.com:8030")
      config.setEventsURI("https://your-relay-proxy.com:8030")