Show / Hide Table of Contents

Class Configuration

Configuration options for LdClient. This class should normally be constructed with Builder(String).

Inheritance
System.Object
Configuration
Namespace: LaunchDarkly.Sdk.Server
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public 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).

Properties

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
System.Boolean

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.

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
System.Boolean

SdkKey

The SDK key for your LaunchDarkly environment.

Declaration
public string SdkKey { get; }
Property Value
Type Description
System.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
System.TimeSpan
Remarks

Setting this to 0 will not block and will cause the constructor to return immediately. The default value is 10 seconds.

Methods

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

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
System.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();

Default(String)

Creates a configuration with all parameters set to the default.

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

the SDK key for your LaunchDarkly environment

Returns
Type Description
Configuration

a Configuration instance

In This Article
Back to top Generated by DocFX