C Server-Side SDK
LaunchDarkly SDK
config.h File Reference

Public API Interface for Configuration. More...

Include dependency graph for config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct LDConfigLDConfigNew (const char *const key)
 Creates a new default configuration. The configuration object is intended to be modified until it is passed to LDClientInit, at which point it should no longer be modified. More...
 
void LDConfigFree (struct LDConfig *const config)
 Destroy a config not associated with a client instance. More...
 
LDBoolean LDConfigSetBaseURI (struct LDConfig *const config, const char *const baseURI)
 Set the base URI for connecting to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly. Defaults to "https://app.launchdarkly.com". More...
 
LDBoolean LDConfigSetStreamURI (struct LDConfig *const config, const char *const streamURI)
 Set the streaming URI for connecting to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly. Defaults to "https://stream.launchdarkly.com". More...
 
LDBoolean LDConfigSetEventsURI (struct LDConfig *const config, const char *const eventsURI)
 Set the events URI for connecting to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly. Defaults to "https://events.launchdarkly.com". More...
 
void LDConfigSetStream (struct LDConfig *const config, const LDBoolean stream)
 Enables or disables real-time streaming flag updates. When set to false, an efficient caching polling mechanism is used. We do not recommend disabling streaming unless you have been instructed to do so by LaunchDarkly support. Defaults to true. More...
 
void LDConfigSetSendEvents (struct LDConfig *const config, const LDBoolean sendEvents)
 Sets whether to send analytics events back to LaunchDarkly. By default, the client will send events. This differs from Offline in that it only affects sending events, not streaming or polling for events from the. More...
 
void LDConfigSetEventsCapacity (struct LDConfig *const config, const unsigned int eventsCapacity)
 The capacity of the events buffer. The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events will be discarded. More...
 
void LDConfigSetTimeout (struct LDConfig *const config, const unsigned int milliseconds)
 The connection timeout to use when making requests to LaunchDarkly. More...
 
void LDConfigSetFlushInterval (struct LDConfig *const config, const unsigned int milliseconds)
 The time between flushes of the event buffer. Decreasing the flush interval means that the event buffer is less likely to reach capacity. More...
 
void LDConfigSetPollInterval (struct LDConfig *const config, const unsigned int milliseconds)
 The polling interval (when streaming is disabled). More...
 
void LDConfigSetOffline (struct LDConfig *const config, const LDBoolean offline)
 Sets whether this client is offline. An offline client will not make any network connections to LaunchDarkly, and will return default values for all feature flags. More...
 
void LDConfigSetUseLDD (struct LDConfig *const config, const LDBoolean useLDD)
 Sets whether this client should use the LaunchDarkly relay in daemon mode. In this mode, the client does not subscribe to the streaming or polling API, but reads data only from the feature store. More...
 
void LDConfigSetAllAttributesPrivate (struct LDConfig *const config, const LDBoolean allAttributesPrivate)
 Sets whether or not all user attributes (other than the key) should be hidden from LaunchDarkly. If this is true, all user attribute values will be private, not just the attributes specified in PrivateAttributeNames. More...
 
void LDConfigInlineUsersInEvents (struct LDConfig *const config, const LDBoolean inlineUsersInEvents)
 Set to true if you need to see the full user details in every analytics event. More...
 
void LDConfigSetUserKeysCapacity (struct LDConfig *const config, const unsigned int userKeysCapacity)
 The number of user keys that the event processor can remember at an one time, so that duplicate user details will not be sent in analytics. More...
 
void LDConfigSetUserKeysFlushInterval (struct LDConfig *const config, const unsigned int milliseconds)
 The interval at which the event processor will reset its set of known user keys. More...
 
LDBoolean LDConfigAddPrivateAttribute (struct LDConfig *const config, const char *const attribute)
 Marks a set of user attribute names private. Any users sent to LaunchDarkly with this configuration active will have attributes with these names removed. More...
 
void LDConfigSetFeatureStoreBackend (struct LDConfig *const config, struct LDStoreInterface *const backend)
 Sets the implementation of FeatureStore for holding feature flags and related data received from LaunchDarkly. More...
 
void LDConfigSetFeatureStoreBackendCacheTTL (struct LDConfig *const config, const unsigned int milliseconds)
 When a feature store backend is provided, configure how long items will be cached in memory. Set the value to zero to always hit the external store backend. If no backend exists this value is ignored. The default cache time is 30 seconds. More...
 
LDBoolean LDConfigSetWrapperInfo (struct LDConfig *const config, const char *const wrapperName, const char *const wrapperVersion)
 Indicates to LaunchDarkly the name and version of an SDK wrapper library. If wrapperVersion is set wrapperName must be set. More...
 

Detailed Description

Public API Interface for Configuration.

Function Documentation

◆ LDConfigAddPrivateAttribute()

LDBoolean LDConfigAddPrivateAttribute ( struct LDConfig *const  config,
const char *const  attribute 
)

Marks a set of user attribute names private. Any users sent to LaunchDarkly with this configuration active will have attributes with these names removed.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]attributeMay not be NULL.
Returns
True on success, False on failure.

◆ LDConfigFree()

void LDConfigFree ( struct LDConfig *const  config)

Destroy a config not associated with a client instance.

Parameters
[in]configMay be NULL.
Returns
Void.

◆ LDConfigInlineUsersInEvents()

void LDConfigInlineUsersInEvents ( struct LDConfig *const  config,
const LDBoolean  inlineUsersInEvents 
)

Set to true if you need to see the full user details in every analytics event.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]inlineUsersInEvents
Returns
Void.

◆ LDConfigNew()

struct LDConfig* LDConfigNew ( const char *const  key)

Creates a new default configuration. The configuration object is intended to be modified until it is passed to LDClientInit, at which point it should no longer be modified.

Parameters
[in]keyYour projects SDK key. May not be NULL.
Returns
NULL on failure.

◆ LDConfigSetAllAttributesPrivate()

void LDConfigSetAllAttributesPrivate ( struct LDConfig *const  config,
const LDBoolean  allAttributesPrivate 
)

Sets whether or not all user attributes (other than the key) should be hidden from LaunchDarkly. If this is true, all user attribute values will be private, not just the attributes specified in PrivateAttributeNames.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]allAttributesPrivate
Returns
Void.

◆ LDConfigSetBaseURI()

LDBoolean LDConfigSetBaseURI ( struct LDConfig *const  config,
const char *const  baseURI 
)

Set the base URI for connecting to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly. Defaults to "https://app.launchdarkly.com".

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]baseURIThe new base URI to use. May not be NULL.
Returns
True on success, False on failure

◆ LDConfigSetEventsCapacity()

void LDConfigSetEventsCapacity ( struct LDConfig *const  config,
const unsigned int  eventsCapacity 
)

The capacity of the events buffer. The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events will be discarded.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]eventsCapacity
Returns
Void.

◆ LDConfigSetEventsURI()

LDBoolean LDConfigSetEventsURI ( struct LDConfig *const  config,
const char *const  eventsURI 
)

Set the events URI for connecting to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly. Defaults to "https://events.launchdarkly.com".

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]eventsURIThe new events URI to use. May not be NULL.
Returns
True on success, False on failure

◆ LDConfigSetFeatureStoreBackend()

void LDConfigSetFeatureStoreBackend ( struct LDConfig *const  config,
struct LDStoreInterface *const  backend 
)

Sets the implementation of FeatureStore for holding feature flags and related data received from LaunchDarkly.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]backendMay be NULL.
Returns
Void.

◆ LDConfigSetFeatureStoreBackendCacheTTL()

void LDConfigSetFeatureStoreBackendCacheTTL ( struct LDConfig *const  config,
const unsigned int  milliseconds 
)

When a feature store backend is provided, configure how long items will be cached in memory. Set the value to zero to always hit the external store backend. If no backend exists this value is ignored. The default cache time is 30 seconds.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]millisecondsHow long the cache should live.
Returns
Void.

◆ LDConfigSetFlushInterval()

void LDConfigSetFlushInterval ( struct LDConfig *const  config,
const unsigned int  milliseconds 
)

The time between flushes of the event buffer. Decreasing the flush interval means that the event buffer is less likely to reach capacity.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]milliseconds
Returns
Void.

◆ LDConfigSetOffline()

void LDConfigSetOffline ( struct LDConfig *const  config,
const LDBoolean  offline 
)

Sets whether this client is offline. An offline client will not make any network connections to LaunchDarkly, and will return default values for all feature flags.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]offline
Returns
Void.

◆ LDConfigSetPollInterval()

void LDConfigSetPollInterval ( struct LDConfig *const  config,
const unsigned int  milliseconds 
)

The polling interval (when streaming is disabled).

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]milliseconds
Returns
Void.

◆ LDConfigSetSendEvents()

void LDConfigSetSendEvents ( struct LDConfig *const  config,
const LDBoolean  sendEvents 
)

Sets whether to send analytics events back to LaunchDarkly. By default, the client will send events. This differs from Offline in that it only affects sending events, not streaming or polling for events from the.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]sendEvents
Returns
Void.

◆ LDConfigSetStream()

void LDConfigSetStream ( struct LDConfig *const  config,
const LDBoolean  stream 
)

Enables or disables real-time streaming flag updates. When set to false, an efficient caching polling mechanism is used. We do not recommend disabling streaming unless you have been instructed to do so by LaunchDarkly support. Defaults to true.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]streamTrue for streaming, False for polling.
Returns
Void.

◆ LDConfigSetStreamURI()

LDBoolean LDConfigSetStreamURI ( struct LDConfig *const  config,
const char *const  streamURI 
)

Set the streaming URI for connecting to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly. Defaults to "https://stream.launchdarkly.com".

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]streamURIThe new stream URI to use. May not be NULL.
Returns
True on success, False on failure

◆ LDConfigSetTimeout()

void LDConfigSetTimeout ( struct LDConfig *const  config,
const unsigned int  milliseconds 
)

The connection timeout to use when making requests to LaunchDarkly.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]milliseconds
Returns
Void.

◆ LDConfigSetUseLDD()

void LDConfigSetUseLDD ( struct LDConfig *const  config,
const LDBoolean  useLDD 
)

Sets whether this client should use the LaunchDarkly relay in daemon mode. In this mode, the client does not subscribe to the streaming or polling API, but reads data only from the feature store.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]useLDD
Returns
Void.

◆ LDConfigSetUserKeysCapacity()

void LDConfigSetUserKeysCapacity ( struct LDConfig *const  config,
const unsigned int  userKeysCapacity 
)

The number of user keys that the event processor can remember at an one time, so that duplicate user details will not be sent in analytics.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]userKeysCapacity
Returns
Void.

◆ LDConfigSetUserKeysFlushInterval()

void LDConfigSetUserKeysFlushInterval ( struct LDConfig *const  config,
const unsigned int  milliseconds 
)

The interval at which the event processor will reset its set of known user keys.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]milliseconds
Returns
Void.

◆ LDConfigSetWrapperInfo()

LDBoolean LDConfigSetWrapperInfo ( struct LDConfig *const  config,
const char *const  wrapperName,
const char *const  wrapperVersion 
)

Indicates to LaunchDarkly the name and version of an SDK wrapper library. If wrapperVersion is set wrapperName must be set.

Parameters
[in]configThe configuration to modify. May not be NULL.
[in]wrapperNameThe name of the wrapper. May be NULL.
[in]wrapperVersionThe version of the wrapper. May be NULL.
Returns
True on success, False on failure.