Class Configuration
Configuration options for LdClient.
Inherited Members
Namespace: LaunchDarkly.Sdk.Client
Assembly: LaunchDarkly.ClientSdk.dll
Syntax
public sealed class Configuration
Remarks
Instances of Configuration are immutable once created. They can be created with the factory method Default(string, AutoEnvAttributes), or using a builder pattern with ImmutableArray<T>.Builder or Builder(Configuration).
Fields
| Edit this page View SourceDefaultBackgroundPollInterval
Default value for BackgroundPollInterval(TimeSpan) and BackgroundPollInterval(TimeSpan).
Declaration
public static readonly TimeSpan DefaultBackgroundPollInterval
Field Value
Type | Description |
---|---|
TimeSpan |
MinimumBackgroundPollInterval
Minimum value for BackgroundPollInterval(TimeSpan) and BackgroundPollInterval(TimeSpan).
Declaration
public static readonly TimeSpan MinimumBackgroundPollInterval
Field Value
Type | Description |
---|---|
TimeSpan |
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 |
AutoEnvAttributes
True if Auto Environment Attributes functionality is enabled. When enabled, the SDK will automatically provide data about the environment where the application is running.
Declaration
public bool AutoEnvAttributes { get; }
Property Value
Type | Description |
---|---|
bool |
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> |
See Also
| Edit this page View SourceDiagnosticOptOut
True if diagnostic events have been disabled.
Declaration
public bool DiagnosticOptOut { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceEnableBackgroundUpdating
Whether to enable feature flag updates when the application is running in the background.
Declaration
public bool EnableBackgroundUpdating { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This is only relevant on mobile platforms.
See Also
| Edit this page View SourceEvaluationReasons
True if LaunchDarkly should provide additional information about how flag values were calculated.
Declaration
public bool EvaluationReasons { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The additional information will then be available through the client's "detail" methods such as BoolVariationDetail(string, bool). Since this increases the size of network requests, such information is not sent unless you set this option to true.
See Also
| Edit this page View SourceEvents
A factory object that creates an implementation of IEventProcessor, responsible for sending analytics events.
Declaration
public IComponentConfigurer<IEventProcessor> Events { get; }
Property Value
Type | Description |
---|---|
IComponentConfigurer<IEventProcessor> |
See Also
| Edit this page View SourceGenerateAnonymousKeys
True if the SDK should provide unique keys for anonymous contexts.
Declaration
public bool GenerateAnonymousKeys { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceHttpConfigurationBuilder
HTTP configuration properties for the SDK.
Declaration
public HttpConfigurationBuilder HttpConfigurationBuilder { get; }
Property Value
Type | Description |
---|---|
HttpConfigurationBuilder |
See Also
| Edit this page View SourceLoggingConfigurationBuilder
Logging configuration properties for the SDK.
Declaration
public LoggingConfigurationBuilder LoggingConfigurationBuilder { get; }
Property Value
Type | Description |
---|---|
LoggingConfigurationBuilder |
See Also
| Edit this page View SourceMobileKey
The key for your LaunchDarkly environment.
Declaration
public string MobileKey { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This should be the "mobile key" field for the environment on your LaunchDarkly dashboard.
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 |
See Also
| Edit this page View SourcePersistenceConfigurationBuilder
Persistent storage configuration properties for the SDK.
Declaration
public PersistenceConfigurationBuilder PersistenceConfigurationBuilder { get; }
Property Value
Type | Description |
---|---|
PersistenceConfigurationBuilder |
See Also
| Edit this page View SourceServiceEndpoints
Defines the base service URIs used by SDK components.
Declaration
public ServiceEndpoints ServiceEndpoints { get; }
Property Value
Type | Description |
---|---|
ServiceEndpoints |
See Also
Methods
| Edit this page View SourceBuilder(Configuration)
Creates a ConfigurationBuilder starting with the properties of an existing Configuration.
Declaration
public static ConfigurationBuilder Builder(Configuration fromConfiguration)
Parameters
Type | Name | Description |
---|---|---|
Configuration | fromConfiguration | the configuration to copy |
Returns
Type | Description |
---|---|
ConfigurationBuilder | a builder object |
Builder(string, AutoEnvAttributes)
Creates a ConfigurationBuilder for constructing a configuration object using a fluent syntax.
Declaration
public static ConfigurationBuilder Builder(string mobileKey, ConfigurationBuilder.AutoEnvAttributes autoEnvAttributes)
Parameters
Type | Name | Description |
---|---|---|
string | mobileKey | the mobile SDK key for your LaunchDarkly environment |
ConfigurationBuilder.AutoEnvAttributes | autoEnvAttributes | Enable / disable Auto Environment Attributes functionality. When enabled, the SDK will automatically provide data about the environment where the application is running. This data makes it simpler to target your mobile customers based on application name or version, or on device characteristics including manufacturer, model, operating system, locale, and so on. We recommend enabling this when you configure the SDK. See our documentation for more details. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | a builder object |
Remarks
This is the only method for building a Configuration if you are setting properties
besides the MobileKey
. 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")
.EventFlushInterval(TimeSpan.FromSeconds(90))
.StartWaitTime(TimeSpan.FromSeconds(5))
.Build();
|
Edit this page
View Source
Default(string, AutoEnvAttributes)
Creates a configuration with all parameters set to the default.
Declaration
public static Configuration Default(string mobileKey, ConfigurationBuilder.AutoEnvAttributes autoEnvAttributes)
Parameters
Type | Name | Description |
---|---|---|
string | mobileKey | the SDK key for your LaunchDarkly environment |
ConfigurationBuilder.AutoEnvAttributes | autoEnvAttributes | Enable / disable Auto Environment Attributes functionality. When enabled, the SDK will automatically provide data about the environment where the application is running. This data makes it simpler to target your mobile customers based on application name or version, or on device characteristics including manufacturer, model, operating system, locale, and so on. We recommend enabling this when you configure the SDK. See our documentation for more details. |
Returns
Type | Description |
---|---|
Configuration | a Configuration instance |