This topic explains how to configure LaunchDarkly SDKs to connect to alternate service endpoints.
Each SDK connects to several LaunchDarkly web services. These include services for getting feature flag data using streaming or polling, and a service for storing analytics events. Optionally, you can configure LaunchDarkly to connect to alternate service endpoints.
Most customers do not need to configure service endpoints. You may need to configure service endpoints in the following situations:
dev-server for testing, and you want to access local flag values from there. To learn more, read Using the LaunchDarkly CLI for local testing.The examples below show how to configure the SDK for each service. In most SDKs, you then need to pass the configuration in as a parameter when you initialize the client. To learn more, read Configuration.
Details about each SDK’s configuration are available in the SDK-specific sections below:
This feature is available in the following client-side SDKs:
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:
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:
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:
To learn more, read ServiceEndpoints.
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:
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.
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:
To learn more, read serviceEndpoints.
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:
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.
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:
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.
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:
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.
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:
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.
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:
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.
To configure an alternate service endpoint for the SDK, use the setStreamURI, setAppURI, and setEventsURI methods to specify the base URIs:
This feature is available for the following server-side SDKs:
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:
First, set up the Apex bridge. If you are a federal customer, make sure you run the Apex bridge within your own FedRAMP-compliant environment. To learn more, read Use the LaunchDarkly Salesforce bridge.
To configure an alternate service endpoint for the SDK, export the alternate URIs before you build the bridge:
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:
To learn more, read ServiceEndpoints() in ConfigBuilder.
To configure an alternate service endpoint for the SDK, use the stream_uri, base_uri, and events_uri properties to set the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
To configure an alternate service endpoint for the SDK, use the Config.ServiceEndpoints property and interfaces.ServiceEndpoints() to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
If you are using LaunchDarkly Go SDK version 7.6 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 EnableGzip and Configuring an SDK to use the Relay Proxy.
To configure an alternate service endpoint for the SDK, use configSetStreamURI, configSetBaseURI, and configSetEventsURI to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
If you are using LaunchDarkly Haskell SDK version 4.4 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 configSetCompressEvents and Configuring an SDK to use the Relay Proxy.
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:
To configure an alternate service endpoint for the SDK, use the serviceEndpoints property to specify the base URLs. Here are some examples for common base URLs that you might use instead of the defaults:
To learn more about the configuration options, read clientInit.
To configure an alternate service endpoint for the SDK, use the streamUri, baseUri, and eventsUri properties to specify the base URIs.
Here are some examples for common base URIs that you might use instead of the defaults:
If you are using LaunchDarkly Node.js (server-side) SDK version 9.8 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 enableEventCompression and Configuring an SDK to use the Relay Proxy.
To configure an alternate service endpoint for the SDK, use the base_uri and events_uri properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
There is not a streaming service for the PHP SDK.
To configure an alternate service endpoint for the SDK, use the stream_uri, base_uri, and events_uri properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
If you are using LaunchDarkly Python SDK version 9.5 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, set enable_event_compression in the ldclient.config module and read Configuring an SDK to use the Relay Proxy.
To configure an alternate service endpoint for the SDK, use the stream_uri, base_uri, and events_uri properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
If you are using LaunchDarkly Ruby SDK version 8.7 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 compress_events and Configuring an SDK to use the Relay Proxy.
To configure an alternate service endpoint for the SDK, use the ConfigBuilder and ServiceEndpointsBuilder to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:
If you are using LaunchDarkly Rust SDK version 2.4 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 compress_events and Configuring an SDK to use the Relay Proxy.