http 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 SDK 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
- Vue: The Vue SDK relies on the JavaScript SDK for these configuration options.
.NET (client-side)
Expand .NET (client-side) code sample
Expand .NET (client-side) code sample
To connect the SDK to the Relay Proxy, use the
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
To connect the SDK to the Relay Proxy, use the
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
To connect the SDK to the Relay Proxy, use To learn more, read
RelayProxyBaseURL to set the base URI of your Relay Proxy:ServiceEndpoints.Electron
Expand Electron code sample
Expand Electron code sample
To connect the SDK to the Relay Proxy, set the
streamUrl, baseUrl, and eventsUrl options to the base URI of your Relay Proxy:Flutter
Expand Flutter code sample
Expand Flutter code sample
To connect the SDK to the Relay Proxy, use the To learn more, read
ServiceEndpoints configuration option to specify the base URI of your Relay Proxy:serviceEndpoints.iOS
Expand iOS code sample
Expand iOS code sample
To connect the SDK to the Relay Proxy, set the
streamUrl, baseUrl, and eventsUrl properties to the base URI of your Relay Proxy:JavaScript
Expand JavaScript code sample
Expand JavaScript code sample
To connect the SDK to the Relay Proxy, set the
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
To connect the SDK to the Relay Proxy, set the
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
To connect the SDK to the Relay Proxy, set the In version 6.x and earlier, the config properties were named
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.0. In version 10.0, they are named streamUri, baseUri, and eventsUri. To learn more, read LDOptions.Roku
Expand Roku code sample
Expand Roku code sample
To connect the SDK to the Relay Proxy, use the
setStreamURI, setAppURI, and setEventsURI methods to specify the base URI of your Relay Proxy:Vue
The Vue SDK relies on the JavaScript SDK for Relay Proxy configuration. Set the service endpoint options inldOptions to your Relay Proxy’s base URI when you install the plugin or create a provider.
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
To connect the SDK to the Relay Proxy, use the
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
To connect the SDK to the Relay Proxy, use To learn more, read
RelayProxyBaseURL to set the base URI of your Relay Proxy:ServiceEndpoints() in ConfigBuilder.Erlang
Expand Erlang code sample
Expand Erlang code sample
To connect the SDK to the Relay Proxy, set the
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
To connect the SDK to the Relay Proxy, use the
Config.ServiceEndpoints property and ldcomponents.RelayProxyEndpoints() to specify the base URI of your Relay Proxy:Haskell
Expand Haskell code sample
Expand Haskell code sample
To connect the SDK to the Relay Proxy, use
configSetStreamURI, configSetBaseURI, and configSetEventsURI to specify the base URI of your Relay Proxy:Java
Expand Java code sample
Expand Java code sample
To connect the SDK to the Relay Proxy, use the
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
To connect the SDK to the Relay Proxy, use the To learn more about the configuration options, read
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
To connect the SDK to the Relay Proxy, set the
streamUri, baseUri, and eventsUri properties to the base URI of your Relay Proxy:PHP
Expand PHP code sample
Expand PHP code sample
To connect the SDK to the Relay Proxy, set the There is not a streaming service for the PHP SDK.
base_uri and events_uri properties to the base URI of your Relay Proxy:Python
Expand Python code sample
Expand Python code sample
To connect the SDK to the Relay Proxy, set the
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
To connect the SDK to the Relay Proxy, set the service endpoints to the base URI of your Relay Proxy:
Rust
Expand Rust code sample
Expand Rust code sample
To connect the SDK to the Relay Proxy, use the
ConfigBuilder and ServiceEndpointsBuilder to specify the base URI of your Relay Proxy: