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.
Overview
Each SDK connects to several LaunchDarkly web services. These include services for getting feature flag data via streaming or polling, and a service for storing analytics events. By default, the SDK connects directly to LaunchDarkly for these services. If you are using the Relay Proxy, you must configure the SDK so that it connects to the Relay Proxy for these services instead. If you use the Relay Proxy in proxy mode, you must know the base uniform resource identifier (URI) of your Relay Proxy instance. This is anhttp or https address with the hostname and port where you have deployed the Relay Proxy. In all of the code examples below, the Relay Proxy’s base URI is https://your-relay-proxy.com:8030, which is its default port.
Different SDKs have different ways of configuring the SDK. In some SDKs, you must set the base URI of each service to the Relay Proxy’s base URI, using a separate configuration property for each service but setting each one to the same value. In other SDKs, you can set the base URI for all services with a single configuration property.
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.
The following examples also include configuring the events service. To learn more, read Deciding how to handle analytics events.
Details about each SDK’s configuration are available in the SDK-specific sections below:
Client-side SDKs
This feature is available in the following client-side SDKs:- .NET (client-side)
- Android
- C++ (client-side)
- Electron
- Flutter
- iOS
- JavaScript
- Node.js (client-side)
- React Native
- React Web The React Web SDK relies on the JavaScript SDK for these configuration options.
- Roku
.NET (client-side)
Expand .NET (client-side) code sample
Expand .NET (client-side) code sample
ServiceEndpoints builder method and Components.ServiceEndpoints().RelayProxy to specify the base URI of your Relay Proxy:Android
Expand Android code sample
Expand Android code sample
streamUri, pollUri, and eventsUri builder methods to specify the base URI of your Relay Proxy:C++ (client-side)
Expand C++ code sample
Expand C++ code sample
RelayProxyBaseURL to set the base URI of your Relay Proxy:ServiceEndpoints.Electron
Expand Electron code sample
Expand Electron code sample
streamUrl, baseUrl, and eventsUrl options to the base URI of your Relay Proxy:Flutter
Expand Flutter code sample
Expand Flutter code sample
ServiceEndpoints configuration option to specify the base URI of your Relay Proxy:serviceEndpoints.iOS
Expand iOS code sample
Expand iOS code sample
streamUrl, baseUrl, and eventsUrl properties to the base URI of your Relay Proxy:Java
ScriptExpand JavaScript code sample
Expand JavaScript code sample
streamUrl, baseUrl, and eventsUrl properties to the base URI of your Relay Proxy:Node.js (client-side)
Expand Node.js (client-side) code sample
Expand Node.js (client-side) code sample
streamUrl, baseUrl, and eventsUrl properties to the base URI of your Relay Proxy:React Native
Expand React Native code sample
Expand React Native code sample
streamUri, baseUri, and eventsUri properties to the base URI of your Relay Proxy:streamUri, pollUri, and eventsUri. They were renamed to streamUrl, pollUrl, and eventsUrl in version 7.- In version 10.0, they are named
streamUri,baseUri, andeventsUri. To learn more, readLDOptions.
Roku
Expand Roku code sample
Expand Roku code sample
setStreamURI, setAppURI, and setEventsURI methods to specify the base URI of your Relay Proxy:Server-side SDKs
This feature is available for the following server-side SDKs:- .NET (server-side)
- C++ (server-side)
- Erlang
- Go
- Haskell
- Java
- Lua
- Node.js (server-side)
- PHP
- Python
- Ruby
- Rust
.NET (server-side)
Expand .NET (server-side) code sample
Expand .NET (server-side) code sample
ServiceEndpoints builder method and Components.ServiceEndpoints().RelayProxy to specify the base URI of your Relay Proxy:C++ (server-side)
Expand C++ (server-side) code sample
Expand C++ (server-side) code sample
RelayProxyBaseURL to set the base URI of your Relay Proxy:ServiceEndpoints() in ConfigBuilder.Erlang
Expand Erlang code sample
Expand Erlang code sample
stream_uri, base_uri, and events_uri properties to the base URI of your Relay Proxy:Go
Expand Go code sample
Expand Go code sample
Config.ServiceEndpoints property and ldcomponents.RelayProxyEndpoints() to specify the base URI of your Relay Proxy:Haskell
Expand Haskell code sample
Expand Haskell code sample
configSetStreamURI, configSetBaseURI, and configSetEventsURI to specify the base URI of your Relay Proxy:Java
Expand Java code sample
Expand Java code sample
serviceEndpoints builder method and Components.serviceEndpoints().relayProxy to specify the base URI of your Relay Proxy:Lua
Expand Lua code sample
Expand Lua code sample
serviceEndpoints property to specify the base URLs:clientInit.Node.js (server-side)
Expand Node.js (server-side) code sample
Expand Node.js (server-side) code sample
streamUri, baseUri, and eventsUri properties to the base URI of your Relay Proxy:PHP
Expand PHP code sample
Expand PHP code sample
base_uri and events_uri properties to the base URI of your Relay Proxy:Python
Expand Python code sample
Expand Python code sample
stream_uri, base_uri, and events_uri properties to the base URI of your Relay Proxy:Ruby
Expand Ruby code sample
Expand Ruby code sample
Rust
Expand Rust code sample
Expand Rust code sample
ConfigBuilder and ServiceEndpointsBuilder to specify the base URI of your Relay Proxy: