> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Service endpoint configuration: Client-side SDKs

> This topic explains how to configure LaunchDarkly SDKs to connect to alternate service endpoints. Typically this is only required for customers working with the LaunchDarkly federal instance. This page covers client-side sdks.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

## Client-side SDKs

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

* [.NET (client-side)](#net-client-side)
* [Android](#android)
* [C++ (client-side)](#c-client-side)
* [Electron](#electron)
* [Flutter](#flutter)
* [iOS](#ios)
* [JavaScript](#javascript)
* [Node.js (client-side)](#nodejs-client-side)
* [React Native](#react-native)
* [React Web](#react-web)
* [Roku](#roku)

### .NET (client-side)

<Accordion title="Expand .NET (client-side) code sample">
  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:

  <CodeGroup>
    ```csharp title="C#, connecting to Relay Proxy" theme={null}
          var config = Configuration
              .Builder("example-mobile-key", ConfigurationBuilder.AutoEnvAttributes.Enabled)
              .ServiceEndpoints(Components.ServiceEndpoints()
                .RelayProxy("https://your-relay-proxy.com:8030"))
              .Build();
    ```

    ```csharp title="C#, connecting to federal instance" theme={null}
          var config = Configuration
              .Builder("example-mobile-key", ConfigurationBuilder.AutoEnvAttributes.Enabled)
              .ServiceEndpoints(Components.ServiceEndpoints()
                .Streaming("https://clientstream.launchdarkly.us")
                .Polling("https://clientsdk.launchdarkly.us")
                .Events("https://events.launchdarkly.us"))
              .Build();
    ```

    ```csharp title="C#, connecting to EU instance" theme={null}
          var config = Configuration
              .Builder("example-mobile-key", ConfigurationBuilder.AutoEnvAttributes.Enabled)
              .ServiceEndpoints(Components.ServiceEndpoints()
                .Streaming("https://clientstream.eu.launchdarkly.com")
                .Polling("https://clientsdk.eu.launchdarkly.com")
                .Events("https://events.eu.launchdarkly.com"))
              .Build();
    ```
  </CodeGroup>
</Accordion>

### Android

<Accordion title="Expand Android code sample">
  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:

  <CodeGroup>
    ```java title="Java, connecting to Relay Proxy" theme={null}
          LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled)
            .mobileKey("example-mobile-key")
            .serviceEndpoints(
              Components.serviceEndpoints()
                .relayProxy("https://your-relay-proxy.com:8030")
            )
            .build();
    ```

    ```java title="Java, connecting to federal instance" theme={null}
          LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled)
            .mobileKey("example-mobile-key")
            .serviceEndpoints(
              Components.serviceEndpoints()
                .streaming("https://clientstream.launchdarkly.us")
                .polling("https://clientsdk.launchdarkly.us")
                .events("https://events.launchdarkly.us")
            )
            .build();
    ```

    ```java title="Java, connecting to EU instance" theme={null}
          LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled)
            .mobileKey("example-mobile-key")
            .serviceEndpoints(
              Components.serviceEndpoints()
                .streaming("https://clientstream.eu.launchdarkly.com")
                .polling("https://clientsdk.eu.launchdarkly.com")
                .events("https://events.eu.launchdarkly.com")
            )
            .build();
    ```

    ```kotlin title="Kotlin, connecting to Relay Proxy" theme={null}
          val ldConfig: LDConfig = LDConfig.Builder(AutoEnvAttributes.Enabled)
            .mobileKey("example-mobile-key")
            .serviceEndpoints(
              Components.serviceEndpoints()
                .relayProxy("https://your-relay-proxy.com:8030")
            )
            .build();
    ```

    ```kotlin title="Kotlin, connecting to federal instance" theme={null}
          val ldConfig: LDConfig = LDConfig.Builder(AutoEnvAttributes.Enabled)
            .mobileKey("example-mobile-key")
            .serviceEndpoints(
              Components.serviceEndpoints()
                .streaming("https://clientstream.launchdarkly.us")
                .polling("https://clientsdk.launchdarkly.us")
                .events("https://events.launchdarkly.us")
            )
            .build();
    ```

    ```kotlin title="Kotlin, connecting to EU instance" theme={null}
          val ldConfig: LDConfig = LDConfig.Builder(AutoEnvAttributes.Enabled)
            .mobileKey("example-mobile-key")
            .serviceEndpoints(
              Components.serviceEndpoints()
                .streaming("https://clientstream.eu.launchdarkly.com")
                .polling("https://clientsdk.eu.launchdarkly.com")
                .events("https://events.eu.launchdarkly.com")
            )
            .build();
    ```
  </CodeGroup>
</Accordion>

### C++ (client-side)

<Accordion title="Expand C++ (client-side) code sample">
  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:

  <CodeGroup>
    ```cpp title="C++ SDK v3.0 (native), connecting to Relay Proxy" theme={null}
          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();
    ```

    ```c title="C++ SDK v3.0 (C binding), connecting to Relay Proxy" theme={null}
          LDClientConfigBuilder builder = LDClientConfigBuilder_New("example-mobile-key");
          LDClientConfigBuilder_ServiceEndpoints_StreamingBaseURL(builder, "https://your-relay-proxy.com:8030")
          LDClientConfigBuilder_ServiceEndpoints_PollingBaseURL(builder, "https://your-relay-proxy.com:8030")
          LDClientConfigBuilder_ServiceEndpoints_EventsBaseURL(builder, "https://your-relay-proxy.com:8030")
          LDClientConfig config;

          LDStatus status = LDClientConfigBuilder_Build(builder, &config);

          if (!LDStatus_Ok(status)) {
              /* an error occurred, config is not valid */
          }
    ```

    ```cpp title="C++ SDK v3.0 (native), connecting to federal instance" theme={null}
          auto config_builder = client_side::ConfigBuilder("example-mobile-key");
          config_builder.ServiceEndpoints()
              .StreamingBaseUrl("https://clientstream.launchdarkly.us")
              .PollingBaseUrl("https://clientsdk.launchdarkly.us")
              .EventsBaseUrl("https://events.launchdarkly.us")
          auto config = config_builder.Build();
    ```

    ```c title="C++ SDK v3.0 (C binding), connecting to federal instance" theme={null}
          LDClientConfigBuilder builder = LDClientConfigBuilder_New("example-mobile-key");
          LDClientConfigBuilder_ServiceEndpoints_StreamingBaseURL(builder, "https://clientstream.launchdarkly.us")
          LDClientConfigBuilder_ServiceEndpoints_PollingBaseURL(builder, "https://clientsdk.launchdarkly.us")
          LDClientConfigBuilder_ServiceEndpoints_EventsBaseURL(builder, "https://events.launchdarkly.us")
          LDClientConfig config;

          LDStatus status = LDClientConfigBuilder_Build(builder, &config);

          if (!LDStatus_Ok(status)) {
              /* an error occurred, config is not valid */
          }
    ```

    ```cpp title="C++ SDK v3.0 (native), connecting to EU instance" theme={null}
          auto config_builder = client_side::ConfigBuilder("example-mobile-key");
          config_builder.ServiceEndpoints()
              .StreamingBaseUrl("https://clientstream.eu.launchdarkly.com")
              .PollingBaseUrl("https://clientsdk.eu.launchdarkly.com")
              .EventsBaseUrl("https://events.eu.launchdarkly.com")
          auto config = config_builder.Build();
    ```

    ```c title="C++ SDK v3.0 (C binding), connecting to EU instance" theme={null}
          LDClientConfigBuilder builder = LDClientConfigBuilder_New("example-mobile-key");
          LDClientConfigBuilder_ServiceEndpoints_StreamingBaseURL(builder, "https://clientstream.eu.launchdarkly.com")
          LDClientConfigBuilder_ServiceEndpoints_PollingBaseURL(builder, "https://clientsdk.eu.launchdarkly.com")
          LDClientConfigBuilder_ServiceEndpoints_EventsBaseURL(builder, "https://events.eu.launchdarkly.com")
          LDClientConfig config;

          LDStatus status = LDClientConfigBuilder_Build(builder, &config);

          if (!LDStatus_Ok(status)) {
              /* an error occurred, config is not valid */
          }
    ```
  </CodeGroup>

  To learn more, read [`ServiceEndpoints`](https://launchdarkly.github.io/cpp-sdks/libs/client-sdk/docs/html/classlaunchdarkly_1_1config_1_1shared_1_1builders_1_1ConfigBuilder.html#ae28867ba563432a91f355d04f45daec2).
</Accordion>

### Electron

<Accordion title="Expand Electron code sample">
  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:

  <CodeGroup>
    ```js title="JavaScript, connecting to Relay Proxy" theme={null}
          const options = {
            streamUrl: 'https://your-relay-proxy.com:8030',
            baseUrl: 'https://your-relay-proxy.com:8030',
            eventsUrl: 'https://your-relay-proxy.com:8030'
          };
    ```

    ```ts title="TypeScript, connecting to Relay Proxy" theme={null}
          import * as LDElectron from 'launchdarkly-electron-client-sdk';

          const options: LDElectron.LDOptions = {
            streamUrl: 'https://your-relay-proxy.com:8030',
            baseUrl: 'https://your-relay-proxy.com:8030',
            eventsUrl: 'https://your-relay-proxy.com:8030',
          };
    ```

    ```js title="JavaScript, connecting to federal instance" theme={null}
          const options = {
            streamUrl: 'https://clientstream.launchdarkly.us',
            baseUrl: 'https://clientsdk.launchdarkly.us',
            eventsUrl: 'https://events.launchdarkly.us'
          };
    ```

    ```ts title="TypeScript, connecting to federal instance" theme={null}
          import * as LDElectron from 'launchdarkly-electron-client-sdk';

          const options: LDElectron.LDOptions = {
            streamUrl: 'https://clientstream.launchdarkly.us',
            baseUrl: 'https://clientsdk.launchdarkly.us',
            eventsUrl: 'https://events.launchdarkly.us'
          };
    ```

    ```js title="JavaScript, connecting to EU instance" theme={null}
          const options = {
            streamUrl: 'https://clientstream.eu.launchdarkly.com',
            baseUrl: 'https://clientsdk.eu.launchdarkly.com',
            eventsUrl: 'https://events.eu.launchdarkly.com'
          };
    ```

    ```ts title="TypeScript, connecting to federal instance" theme={null}
          import * as LDElectron from 'launchdarkly-electron-client-sdk';

          const options: LDElectron.LDOptions = {
            streamUrl: 'https://clientstream.eu.launchdarkly.com',
            baseUrl: 'https://clientsdk.eu.launchdarkly.com',
            eventsUrl: 'https://events.eu.launchdarkly.com'
          };
    ```
  </CodeGroup>

  The Electron SDK uses the `baseUrl` for the initial connection and subsequent `identify` calls.

  If you have enabled [streaming](https://launchdarkly.github.io/electron-client-sdk/interfaces/_launchdarkly_electron_client_sdk_.ldoptions.html#streaming), the SDK uses the `streamUrl` for subsequent connections. If you have enabled [`useReport`](https://launchdarkly.github.io/electron-client-sdk/interfaces/_launchdarkly_electron_client_sdk_.ldoptions.html#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](https://github.com/launchdarkly/js-eventsource) to provide streaming support. Otherwise, these requests will be standard `REPORT` http requests. To learn more, read [EventSource](/sdk/client-side/javascript/requirements-polyfills#eventsource) under [Requirements and polyfills](/sdk/client-side/javascript/requirements-polyfills).
</Accordion>

### Flutter

<Accordion title="Expand Flutter code sample">
  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:

  <CodeGroup>
    ```dart title="Flutter SDK v4, connecting to Relay Proxy" theme={null}
          final config = LDConfig(
            CredentialSource.fromEnvironment(),
            autoEnvAttributes.enabled,
            serviceEndpoints: ServiceEndpoints.relayProxy('https://your-relay-proxy.com:8030')
          );
    ```

    ```dart title="Flutter SDK v4, connecting to federal instance" theme={null}
          final config = LDConfig(
            CredentialSource.fromEnvironment(),
            autoEnvAttributes.enabled,
            serviceEndpoints: ServiceEndpoints.custom(
              streaming: 'https://clientstream.launchdarkly.us',
              polling: 'https://clientsdk.launchdarkly.us',
              events: 'https://events.launchdarkly.us',
            )
          );
    ```

    ```dart title="Flutter SDK v4, connecting to EU instance" theme={null}
          final config = LDConfig(
            CredentialSource.fromEnvironment(),
            autoEnvAttributes.enabled,
            serviceEndpoints: ServiceEndpoints.custom(
              streaming: 'https://clientstream.eu.launchdarkly.com',
              polling: 'https://clientsdk.eu.launchdarkly.com',
              events: 'https://events.eu.launchdarkly.com',
            )
          );
    ```

    ```dart title="Flutter SDK v3, connecting to Relay Proxy" theme={null}
          LDConfig ldConfig = LDConfigBuilder('example-mobile-key', AutoEnvAttributes.Enabled)
            .streamUri('https://your-relay-proxy.com:8030')
            .pollUri('https://your-relay-proxy.com:8030')
            .eventsUri('https://your-relay-proxy.com:8030')
            .build();
    ```

    ```dart title="Flutter SDK v3, connecting to federal instance" theme={null}
          LDConfig ldConfig = LDConfigBuilder('example-mobile-key', AutoEnvAttributes.Enabled)
            .streamUri('https://clientstream.launchdarkly.us')
            .pollUri('https://clientsdk.launchdarkly.us')
            .eventsUri('https://events.launchdarkly.us')
            .build();
    ```

    ```dart title="Flutter SDK v3, connecting to EU instance" theme={null}
          LDConfig ldConfig = LDConfigBuilder('example-mobile-key', AutoEnvAttributes.Enabled)
            .streamUri('https://clientstream.eu.launchdarkly.com')
            .pollUri('https://clientsdk.eu.launchdarkly.com')
            .eventsUri('https://events.eu.launchdarkly.com')
            .build();
    ```
  </CodeGroup>

  To learn more, read [`serviceEndpoints`](https://pub.dev/documentation/launchdarkly_flutter_client_sdk/latest/launchdarkly_flutter_client_sdk/LDConfig/serviceEndpoints.html).
</Accordion>

### iOS

<Accordion title="Expand iOS code sample">
  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:

  <CodeGroup>
    ```swift title="Swift, connecting to Relay Proxy" theme={null}
          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")
    ```

    ```objectivec title="Objective-C, connecting to Relay Proxy" theme={null}
          LDConfig *ldConfig = [[LDConfig alloc] initWithMobileKey:@"example-mobile-key" autoEnvAttributes:AutoEnvAttributesEnabled];
          ldConfig.streamUrl = [NSURL URLWithString:@"https://your-relay-proxy.com:8030"];
          ldConfig.baseUrl = [NSURL URLWithString:@"https://your-relay-proxy.com:8030"];
          ldConfig.eventsUrl = [NSURL URLWithString:@"https://your-relay-proxy.com:8030"];
    ```

    ```swift title="Swift, connecting to federal instance" theme={null}
          var ldConfig = LDConfig(mobileKey: "example-mobile-key", autoEnvAttributes: .enabled)
          ldConfig.streamUrl = URL(string: "https://clientstream.launchdarkly.us")
          ldConfig.baseUrl = URL(string: "https://clientsdk.launchdarkly.us")
          ldConfig.eventsUrl = URL(string: "https://events.launchdarkly.us")
    ```

    ```objectivec title="Objective-C, connecting to federal instance" theme={null}
          LDConfig *ldConfig = [[LDConfig alloc] initWithMobileKey:@"example-mobile-key" autoEnvAttributes:AutoEnvAttributesEnabled];
          ldConfig.streamUrl = [NSURL URLWithString:@"https://clientstream.launchdarkly.us"];
          ldConfig.baseUrl = [NSURL URLWithString:@"https://clientsdk.launchdarkly.us"];
          ldConfig.eventsUrl = [NSURL URLWithString:@"https://events.launchdarkly.us"];
    ```

    ```swift title="Swift, connecting to EU instance" theme={null}
          var ldConfig = LDConfig(mobileKey: "example-mobile-key", autoEnvAttributes: .enabled)
          ldConfig.streamUrl = URL(string: "https://clientstream.eu.launchdarkly.com")
          ldConfig.baseUrl = URL(string: "https://clientsdk.eu.launchdarkly.com")
          ldConfig.eventsUrl = URL(string: "https://events.eu.launchdarkly.com")
    ```

    ```objectivec title="Objective-C, connecting to EU instance" theme={null}
          LDConfig *ldConfig = [[LDConfig alloc] initWithMobileKey:@"example-mobile-key" autoEnvAttributes:AutoEnvAttributesEnabled];
          ldConfig.streamUrl = [NSURL URLWithString:@"https://clientstream.eu.launchdarkly.com"];
          ldConfig.baseUrl = [NSURL URLWithString:@"https://clientsdk.eu.launchdarkly.com"];
          ldConfig.eventsUrl = [NSURL URLWithString:@"https://events.eu.launchdarkly.com"];
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    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`](https://launchdarkly.github.io/ios-client-sdk/Structs/LDConfig.html#/s:12LaunchDarkly8LDConfigV17enableCompressionSbvp) and [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>

### Java

Script

<Accordion title="Expand JavaScript code sample">
  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:

  <CodeGroup>
    ```js title="Connect to Relay Proxy, JS SDK v4.x" theme={null}
          const options = {
            streamUri: 'https://your-relay-proxy.com:8030',
            baseUri: 'https://your-relay-proxy.com:8030',
            eventsUri: 'https://your-relay-proxy.com:8030'
          };
    ```

    ```js title="Connect to Relay Proxy, JS SDK v3.x" theme={null}
          const options = {
            streamUrl: 'https://your-relay-proxy.com:8030',
            baseUrl: 'https://your-relay-proxy.com:8030',
            eventsUrl: 'https://your-relay-proxy.com:8030'
          };
    ```

    ```js title="Connect to federal instance, JS SDK v4.x" theme={null}
          const options = {
            streamUri: 'https://clientstream.launchdarkly.us',
            baseUri: 'https://clientsdk.launchdarkly.us',
            eventsUri: 'https://events.launchdarkly.us'
          };
    ```

    ```js title="Connect to federal instance, JS SDK v3.x" theme={null}
          const options = {
            streamUrl: 'https://clientstream.launchdarkly.us',
            baseUrl: 'https://clientsdk.launchdarkly.us',
            eventsUrl: 'https://events.launchdarkly.us'
          };
    ```

    ```js title="Connect to EU instance, JS SDK v4.x" theme={null}
          const options = {
            streamUri: 'https://clientstream.eu.launchdarkly.com',
            baseUri: 'https://clientsdk.eu.launchdarkly.com',
            eventsUri: 'https://events.eu.launchdarkly.com'
          };
    ```

    ```js title="Connect to EU instance, JS SDK v3.x" theme={null}
          const options = {
            streamUrl: 'https://clientstream.eu.launchdarkly.com',
            baseUrl: 'https://clientsdk.eu.launchdarkly.com',
            eventsUrl: 'https://events.eu.launchdarkly.com'
          };
    ```
  </CodeGroup>

  The JavaScript SDK uses the `baseUri` for the initial connection and subsequent `identify` calls.

  If you have enabled [streaming](/sdk/client-side/javascript#subscribe-to-flag-changes), the SDK uses the `streamUri` for subsequent connections. If you have enabled [`useReport`](https://launchdarkly.github.io/js-core/packages/sdk/browser/docs/interfaces/LDOptions.html#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](https://github.com/launchdarkly/js-eventsource) to provide streaming support. Otherwise, these requests will be standard `REPORT` http requests. To learn more, read [EventSource](/sdk/client-side/javascript/requirements-polyfills#eventsource) under [Requirements and polyfills](/sdk/client-side/javascript/requirements-polyfills).
</Accordion>

### Node.js (client-side)

<Accordion title="Expand Node.js (client-side) code sample">
  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:

  <CodeGroup>
    ```js title="JavaScript, connecting to Relay Proxy" theme={null}
          const options = {
            streamUrl: 'https://your-relay-proxy.com:8030',
            baseUrl: 'https://your-relay-proxy.com:8030',
            eventsUrl: 'https://your-relay-proxy.com:8030'
          };
    ```

    ```ts title="TypeScript, connecting to Relay Proxy" theme={null}
          import * as ld from 'launchdarkly-node-client-sdk';

          const options: ld.LDOptions = {
            streamUrl: 'https://your-relay-proxy.com:8030',
            baseUrl: 'https://your-relay-proxy.com:8030',
            eventsUrl: 'https://your-relay-proxy.com:8030',
          };
    ```

    ```js title="JavaScript, connecting to federal instance" theme={null}
          const options = {
            streamUrl: 'https://clientstream.launchdarkly.us',
            baseUrl: 'https://clientsdk.launchdarkly.us',
            eventsUrl: 'https://events.launchdarkly.us'
          };

    ```

    ```ts title="TypeScript, connecting to federal instance" theme={null}
          import * as ld from 'launchdarkly-node-client-sdk';

          const options: ld.LDOptions = {
            streamUrl: 'https://clientstream.launchdarkly.us',
            baseUrl: 'https://clientsdk.launchdarkly.us',
            eventsUrl: 'https://events.launchdarkly.us',
          };
    ```

    ```js title="JavaScript, connecting to EU instance" theme={null}
          const options = {
            streamUrl: 'https://clientstream.eu.launchdarkly.com',
            baseUrl: 'https://clientsdk.eu.launchdarkly.com',
            eventsUrl: 'https://events.eu.launchdarkly.com'
          };

    ```

    ```ts title="TypeScript, connecting to EU instance" theme={null}
          import * as ld from 'launchdarkly-node-client-sdk';

          const options: ld.LDOptions = {
            streamUrl: 'https://clientstream.eu.launchdarkly.com',
            baseUrl: 'https://clientsdk.eu.launchdarkly.com',
            eventsUrl: 'https://events.eu.launchdarkly.com',
          };
    ```
  </CodeGroup>

  The Node.js (client-side) SDK uses the `baseUrl` for the initial connection and subsequent `identify` calls.

  If you have enabled [streaming](/sdk/client-side/node-js#subscribe-to-flag-changes), the SDK uses the `streamUrl` for subsequent connections. If you have enabled [`useReport`](https://launchdarkly.github.io/node-client-sdk/interfaces/LDOptions.html#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](https://github.com/launchdarkly/js-eventsource) to provide streaming support. Otherwise, these requests will be standard `REPORT` http requests. To learn more, read [EventSource](/sdk/client-side/javascript/requirements-polyfills#eventsource) under [Requirements and polyfills](/sdk/client-side/javascript/requirements-polyfills).
</Accordion>

### React Native

<Accordion title="Expand React Native code sample">
  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:

  <CodeGroup>
    ```ts title="React Native SDK v10, connecting to Relay Proxy" theme={null}
          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',
          };
    ```

    ```ts title="React Native SDK v10, connecting to federal instance" theme={null}
          import { LDOptions } from '@launchdarkly/react-native-client-sdk'

          let options: LDOptions = {
            streamUri: 'https://clientstream.launchdarkly.us',
            baseUri: 'https://clientsdk.launchdarkly.us',
            eventsUri: 'https://events.launchdarkly.us',
          };
    ```

    ```ts title="React Native SDK v10, connecting to EU instance" theme={null}
          import { LDOptions } from '@launchdarkly/react-native-client-sdk'

          let options: LDOptions = {
            streamUri: 'https://clientstream.eu.launchdarkly.com',
            baseUri: 'https://clientsdk.eu.launchdarkly.com',
            eventsUri: 'https://events.eu.launchdarkly.com',
          };
    ```
  </CodeGroup>

  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.

  0. In version 10.0, they are named `streamUri`, `baseUri`, and `eventsUri`. To learn more, read [`LDOptions`](https://launchdarkly.github.io/js-core/packages/sdk/react-native/docs/index.html#LDOptions).
</Accordion>

### React Web

<Accordion title="Expand React Web code sample">
  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:

  <CodeGroup>
    ```js title="JavaScript, connecting to Relay Proxy" theme={null}
          const options = {
            baseUrl: 'https://your-relay-proxy.com:8030',
            streamUrl: 'https://your-relay-proxy.com:8030',
            eventsUrl: 'https://your-relay-proxy.com:8030'
          };
    ```

    ```js title="JavaScript, connecting to federal instance" theme={null}
          const options = {
            baseUrl:"https://clientsdk.launchdarkly.us",
            streamUrl:"https://clientstream.launchdarkly.us",
            eventsUrl:"https://events.launchdarkly.us"
          };
    ```

    ```js title="JavaScript, connecting to EU instance" theme={null}
          const options = {
            baseUrl:"https://clientsdk.eu.launchdarkly.com",
            streamUrl:"https://clientstream.eu.launchdarkly.com",
            eventsUrl:"https://events.eu.launchdarkly.com"
          };
    ```
  </CodeGroup>

  The React Web SDK uses the `baseUrl` for the initial connection and subsequent `identify` calls.

  If you have enabled [streaming](/sdk/client-side/react/react-web#subscribe-to-flag-changes), the SDK uses the `streamUrl` for subsequent connections. If you have enabled [`useReport`](https://launchdarkly.github.io/node-client-sdk/interfaces/LDOptions.html#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](https://github.com/launchdarkly/js-eventsource) to provide streaming support. Otherwise, these requests will be standard `REPORT` http requests. To learn more, read [EventSource](/sdk/client-side/javascript/requirements-polyfills#eventsource) under [Requirements and polyfills](/sdk/client-side/javascript/requirements-polyfills).

  To learn more, read [Configuration options](/sdk/client-side/react/react-web#configuration-options) in the [React Web SDK reference](/sdk/client-side/react/react-web).
</Accordion>

### Roku

<Accordion title="Expand Roku code sample">
  To configure an alternate service endpoint for the SDK, use the `setStreamURI`, `setAppURI`, and `setEventsURI` methods to specify the base URIs:

  <CodeGroup>
    ```brightscript title="BrightScript, connecting to Relay Proxy" theme={null}
          ' 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")
    ```
  </CodeGroup>
</Accordion>
