Class Configuration
Configuration options for LdClient. This class should normally be constructed with Builder(string).
Inherited Members
Namespace: LaunchDarkly.Sdk.Server
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public class Configuration
Remarks
Instances of Configuration are immutable once created. They can be created with the factory method Default(string), or using a builder pattern with Builder(string) or Builder(Configuration).
Properties
| Edit this page View SourceApplicationInfo
ApplicationInfo configuration which contains info about the application the SDK is running in.
Declaration
public ApplicationInfoBuilder ApplicationInfo { get; }
Property Value
Type | Description |
---|---|
ApplicationInfoBuilder |
BigSegments
A builder for BigSegmentsConfiguration.
Declaration
public IComponentConfigurer<BigSegmentsConfiguration> BigSegments { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<BigSegmentsConfiguration> |
DataSource
A factory object that creates an implementation of IDataSource, which will receive feature flag data.
Declaration
public IComponentConfigurer<IDataSource> DataSource { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<IDataSource> |
DataStore
A factory object that creates an implementation of IDataStore, to be used for holding feature flags and related data received from LaunchDarkly.
Declaration
public IComponentConfigurer<IDataStore> DataStore { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<IDataStore> |
Remarks
The default is InMemoryDataStore, but you may provide a custom implementation.
DiagnosticOptOut
True if diagnostic events have been disabled.
Declaration
public bool DiagnosticOptOut { get; }
Property Value
Type | Description |
---|---|
bool |
Events
A factory object that creates an implementation of IEventProcessor, which will process all analytics events.
Declaration
public IComponentConfigurer<IEventProcessor> Events { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<IEventProcessor> |
Remarks
The default is SendEvents(), but you may provide a custom implementation.
Hooks
Hooks configuration which contains a list of zero or more hooks to be executed by the SDK at points of interest.
Declaration
public HookConfigurationBuilder Hooks { get; }
Property Value
Type | Description |
---|---|
HookConfigurationBuilder |
Http
A builder that creates an HttpConfiguration, defining the SDK's networking behavior.
Declaration
public IComponentConfigurer<HttpConfiguration> Http { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<HttpConfiguration> |
Logging
A builder that creates a LoggingConfiguration, defining the SDK's logging configuration.
Declaration
public IComponentConfigurer<LoggingConfiguration> Logging { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<LoggingConfiguration> |
Remarks
SDK components should not use this property directly; instead, the SDK client will use it to create a logger instance which will be in LdClientContext.
Offline
Whether or not this client is offline. If true, no calls to Launchdarkly will be made.
Declaration
public bool Offline { get; }
Property Value
Type | Description |
---|---|
bool |
SdkKey
The SDK key for your LaunchDarkly environment.
Declaration
public string SdkKey { get; }
Property Value
Type | Description |
---|---|
string |
ServiceEndpoints
Defines the base service URIs used by SDK components.
Declaration
public ServiceEndpoints ServiceEndpoints { get; }
Property Value
Type | Description |
---|---|
ServiceEndpoints |
StartWaitTime
How long the client constructor will block awaiting a successful connection to LaunchDarkly.
Declaration
public TimeSpan StartWaitTime { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Remarks
Setting this to 0 will not block and will cause the constructor to return immediately. The default value is 10 seconds.
WrapperInfo
WrapperInfo configuration which contains wrapper configuration. This is primarily intended for use by LaunchDarkly when developing wrapper SDKs.
Declaration
public WrapperInfoBuilder WrapperInfo { get; }
Property Value
Type | Description |
---|---|
WrapperInfoBuilder |
Methods
| Edit this page View SourceBuilder(Configuration)
Creates an ConfigurationBuilder based on an existing configuration.
Declaration
public static ConfigurationBuilder Builder(Configuration fromConfiguration)
Parameters
Type | Name | Description |
---|---|---|
Configuration | fromConfiguration | the existing configuration |
Returns
Type | Description |
---|---|
ConfigurationBuilder | a builder object |
Remarks
Modifying properties of the builder will not affect the original configuration object.
Examples
var configWithCustomEventProperties = Configuration.Builder(originalConfig)
.Events(Components.SendEvents().Capacity(50000))
.Build();
|
Edit this page
View Source
Builder(string)
Creates a ConfigurationBuilder for constructing a configuration object using a fluent syntax.
Declaration
public static ConfigurationBuilder Builder(string sdkKey)
Parameters
Type | Name | Description |
---|---|---|
string | sdkKey | the SDK key for your LaunchDarkly environment |
Returns
Type | Description |
---|---|
ConfigurationBuilder | a builder object |
Remarks
This is the only method for building a Configuration if you are setting properties
besides the SdkKey
. The ConfigurationBuilder has methods for setting any number of
properties, after which you call Build() to get the resulting
Configuration
instance.
Examples
var config = Configuration.Builder("my-sdk-key")
.StartWaitTime(TimeSpan.FromSeconds(5))
.Build();
|
Edit this page
View Source
Default(string)
Creates a configuration with all parameters set to the default.
Declaration
public static Configuration Default(string sdkKey)
Parameters
Type | Name | Description |
---|---|---|
string | sdkKey | the SDK key for your LaunchDarkly environment |
Returns
Type | Description |
---|---|
Configuration | a |