C Client-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 LDConfig * LDConfigNew (const char *const mobileKey)
 Creates a new default configuration. mobileKey is required. More...
 
void LDConfigSetAllAttributesPrivate (struct LDConfig *const config, const LDBoolean allPrivate)
 Marks all user attributes private.
 
void LDConfigSetBackgroundPollingIntervalMillis (struct LDConfig *const config, const int millis)
 Sets the interval in milliseconds between polls for flag updates when your app is in the background.
 
LDBoolean LDConfigSetAppURI (struct LDConfig *const config, const char *const uri)
 Sets the interval in milliseconds between polls for flag updates when your app is in the background.
 
void LDConfigSetConnectionTimeoutMillies (struct LDConfig *const config, const int millis)
 Sets the timeout in milliseconds when connecting to LaunchDarkly.
 
void LDConfigSetDisableBackgroundUpdating (struct LDConfig *const config, const LDBoolean disable)
 Enable or disable background updating.
 
void LDConfigSetEventsCapacity (struct LDConfig *const config, const int capacity)
 Sets the max number of events to queue before sending them to LaunchDarkly.
 
void LDConfigSetEventsFlushIntervalMillis (struct LDConfig *const config, const int millis)
 Sets the maximum amount of time in milliseconds to wait in between sending analytics events to LaunchDarkly.
 
LDBoolean LDConfigSetEventsURI (struct LDConfig *const config, const char *const uri)
 Set the events uri for sending analytics to LaunchDarkly. You probably don't need to set this unless instructed by LaunchDarkly.
 
LDBoolean LDConfigSetMobileKey (struct LDConfig *const config, const char *const key)
 Sets the key for authenticating with LaunchDarkly. This is required unless you're using the client in offline mode.
 
void LDConfigSetOffline (struct LDConfig *const config, const LDBoolean offline)
 Configures the client for offline mode. In offline mode, no external network connections are made.
 
void LDConfigSetStreaming (struct LDConfig *const config, const LDBoolean streaming)
 Enables or disables real-time streaming flag updates. More...
 
void LDConfigSetPollingIntervalMillis (struct LDConfig *const config, const int millis)
 Only relevant when streaming is disabled (set to false). Sets the interval between feature flag updates.
 
LDBoolean LDConfigSetStreamURI (struct LDConfig *const config, const char *const uri)
 Set the stream uri for connecting to the flag update stream. You probably don't need to set this unless instructed by LaunchDarkly.
 
LDBoolean LDConfigSetProxyURI (struct LDConfig *const config, const char *const uri)
 Set the proxy server used for connecting to LaunchDarkly. More...
 
void LDConfigSetVerifyPeer (struct LDConfig *const config, const LDBoolean enabled)
 Set whether to verify the authenticity of the peer's certificate on network requests. More...
 
void LDConfigSetUseReport (struct LDConfig *const config, const LDBoolean report)
 Determines whether the REPORT or GET verb is used for calls to LaunchDarkly. Do not use unless advised by LaunchDarkly.
 
void LDConfigSetUseEvaluationReasons (struct LDConfig *const config, const LDBoolean reasons)
 Decide whether the client should fetch feature flag evaluation explanations from LaunchDarkly.
 
void LDConfigSetPrivateAttributes (struct LDConfig *const config, struct LDJSON *attributes)
 Private attribute list which will not be recorded for all users.
 
LDBoolean LDConfigAddSecondaryMobileKey (struct LDConfig *const config, const char *const name, const char *const key)
 Add another mobile key to the list of secondary environments. More...
 
LDBoolean LDConfigSetSSLCertificateAuthority (struct LDConfig *const config, const char *const certFile)
 Set the path to the SSL certificate bundle used for peer authentication. More...
 
void LDConfigSetInlineUsersInEvents (struct LDConfig *const config, const LDBoolean inlineUsers)
 Determines if an entire user object, or only the user key should be included in events. Defaults to false.
 
void LDConfigFree (struct LDConfig *const config)
 Free an existing LDConfig instance. More...
 

Detailed Description

Public API Interface for Configuration.

Function Documentation

◆ LDConfigAddSecondaryMobileKey()

LDBoolean LDConfigAddSecondaryMobileKey ( struct LDConfig *const  config,
const char *const  name,
const char *const  key 
)

Add another mobile key to the list of secondary environments.

Both name, and key must be unique. You may not add the existing primary environment (the one you used to initialize LDConfig). The name of the key can later be used in conjunction with LDClientGetForMobileKey. This function returns false on failure.

◆ LDConfigFree()

void LDConfigFree ( struct LDConfig *const  config)

Free an existing LDConfig instance.

You will likely never use this routine as ownership is transferred to LDClient on initialization.

◆ LDConfigNew()

struct LDConfig* LDConfigNew ( const char *const  mobileKey)

Creates a new default configuration. mobileKey is required.

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

◆ LDConfigSetProxyURI()

LDBoolean LDConfigSetProxyURI ( struct LDConfig *const  config,
const char *const  uri 
)

Set the proxy server used for connecting to LaunchDarkly.

By default no proxy is used. The URI string should be of the form socks5://127.0.0.1:9050. You may read more about how this SDK handles proxy servers by reading the libcurl documentation on the subject here.

◆ LDConfigSetSSLCertificateAuthority()

LDBoolean LDConfigSetSSLCertificateAuthority ( struct LDConfig *const  config,
const char *const  certFile 
)

Set the path to the SSL certificate bundle used for peer authentication.

This API is ineffective if LDConfigSetVerifyPeer is set to false. See CURLOPT_CAINFO for more information.

◆ LDConfigSetStreaming()

void LDConfigSetStreaming ( struct LDConfig *const  config,
const LDBoolean  streaming 
)

Enables or disables real-time streaming flag updates.

Default: true. 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.

◆ LDConfigSetVerifyPeer()

void LDConfigSetVerifyPeer ( struct LDConfig *const  config,
const LDBoolean  enabled 
)

Set whether to verify the authenticity of the peer's certificate on network requests.

By default peer verification is enabled. You may read more about what this means by reading the libcurl documentation on the subject here.