Show / Hide Table of Contents

Class Configuration

Configuration options for LdClient.

Inheritance
System.Object
Configuration
Namespace: LaunchDarkly.Sdk.Client
Assembly: LaunchDarkly.ClientSdk.dll
Syntax
public sealed class Configuration : Object
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).

Fields

DefaultBackgroundPollInterval

Default value for BackgroundPollInterval(TimeSpan) and BackgroundPollInterval(TimeSpan).

Declaration
public static readonly TimeSpan DefaultBackgroundPollInterval
Field Value
Type Description
System.TimeSpan

MinimumBackgroundPollInterval

Minimum value for BackgroundPollInterval(TimeSpan) and BackgroundPollInterval(TimeSpan).

Declaration
public static readonly TimeSpan MinimumBackgroundPollInterval
Field Value
Type Description
System.TimeSpan

Properties

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
DataSource(IComponentConfigurer<IDataSource>)

DiagnosticOptOut

True if diagnostic events have been disabled.

Declaration
public bool DiagnosticOptOut { get; }
Property Value
Type Description
System.Boolean
See Also
DiagnosticOptOut(Boolean)

EnableBackgroundUpdating

Whether to enable feature flag updates when the application is running in the background.

Declaration
public bool EnableBackgroundUpdating { get; }
Property Value
Type Description
System.Boolean
Remarks

This is only relevant on mobile platforms.

See Also
EnableBackgroundUpdating(Boolean)

EvaluationReasons

True if LaunchDarkly should provide additional information about how flag values were calculated.

Declaration
public bool EvaluationReasons { get; }
Property Value
Type Description
System.Boolean
Remarks

The additional information will then be available through the client's "detail" methods such as BoolVariationDetail(String, Boolean). Since this increases the size of network requests, such information is not sent unless you set this option to true.

See Also
EvaluationReasons(Boolean)

Events

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
Events(IComponentConfigurer<IEventProcessor>)

GenerateAnonymousKeys

True if the SDK should provide unique keys for anonymous contexts.

Declaration
public bool GenerateAnonymousKeys { get; }
Property Value
Type Description
System.Boolean
See Also
GenerateAnonymousKeys(Boolean)

HttpConfigurationBuilder

HTTP configuration properties for the SDK.

Declaration
public HttpConfigurationBuilder HttpConfigurationBuilder { get; }
Property Value
Type Description
HttpConfigurationBuilder
See Also
Http(HttpConfigurationBuilder)

LoggingConfigurationBuilder

Logging configuration properties for the SDK.

Declaration
public LoggingConfigurationBuilder LoggingConfigurationBuilder { get; }
Property Value
Type Description
LoggingConfigurationBuilder
See Also
Logging(LoggingConfigurationBuilder)

MobileKey

The key for your LaunchDarkly environment.

Declaration
public string MobileKey { get; }
Property Value
Type Description
System.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
System.Boolean
See Also
Offline(Boolean)

PersistenceConfigurationBuilder

Persistent storage configuration properties for the SDK.

Declaration
public PersistenceConfigurationBuilder PersistenceConfigurationBuilder { get; }
Property Value
Type Description
PersistenceConfigurationBuilder
See Also
Persistence(PersistenceConfigurationBuilder)

ServiceEndpoints

Defines the base service URIs used by SDK components.

Declaration
public ServiceEndpoints ServiceEndpoints { get; }
Property Value
Type Description
ServiceEndpoints
See Also
ServiceEndpoints(ServiceEndpointsBuilder)

Methods

Builder(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)

Creates a ConfigurationBuilder for constructing a configuration object using a fluent syntax.

Declaration
public static ConfigurationBuilder Builder(string mobileKey)
Parameters
Type Name Description
System.String mobileKey

the mobile 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 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();

Default(String)

Creates a configuration with all parameters set to the default.

Declaration
public static Configuration Default(string mobileKey)
Parameters
Type Name Description
System.String mobileKey

the SDK key for your LaunchDarkly environment

Returns
Type Description
Configuration

a Configuration instance

In This Article
Back to top Generated by DocFX