diff --git a/index.html b/index.html new file mode 100644 index 0000000..6b3da4c --- /dev/null +++ b/index.html @@ -0,0 +1,64 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ + + +

Modules

+ + + + + + + + + +
launchdarkly-server-sdk-redisServer-side SDK for LaunchDarkly Redis store.
launchdarkly-server-sdkServer-side SDK for LaunchDarkly.
+ +
+
+
+generated by LDoc 1.4.6 +Last updated 2023-12-18 22:51:07 +
+
+ + diff --git a/ldoc.css b/ldoc.css new file mode 100644 index 0000000..52c4ad2 --- /dev/null +++ b/ldoc.css @@ -0,0 +1,303 @@ +/* BEGIN RESET + +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +html { + color: #000; + background: #FFF; +} +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { + margin: 0; + padding: 0; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +fieldset,img { + border: 0; +} +address,caption,cite,code,dfn,em,strong,th,var,optgroup { + font-style: inherit; + font-weight: inherit; +} +del,ins { + text-decoration: none; +} +li { + margin-left: 20px; +} +caption,th { + text-align: left; +} +h1,h2,h3,h4,h5,h6 { + font-size: 100%; + font-weight: bold; +} +q:before,q:after { + content: ''; +} +abbr,acronym { + border: 0; + font-variant: normal; +} +sup { + vertical-align: baseline; +} +sub { + vertical-align: baseline; +} +legend { + color: #000; +} +input,button,textarea,select,optgroup,option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} +input,button,textarea,select {*font-size:100%; +} +/* END RESET */ + +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color: #ffffff; margin: 0px; +} + +code, tt { font-family: monospace; font-size: 1.1em; } +span.parameter { font-family:monospace; } +span.parameter:after { content:":"; } +span.types:before { content:"("; } +span.types:after { content:")"; } +.type { font-weight: bold; font-style:italic } + +body, p, td, th { font-size: .95em; line-height: 1.2em;} + +p, ul { margin: 10px 0 0 0px;} + +strong { font-weight: bold;} + +em { font-style: italic;} + +h1 { + font-size: 1.5em; + margin: 20px 0 20px 0; +} +h2, h3, h4 { margin: 15px 0 10px 0; } +h2 { font-size: 1.25em; } +h3 { font-size: 1.15em; } +h4 { font-size: 1.06em; } + +a:link { font-weight: bold; color: #004080; text-decoration: none; } +a:visited { font-weight: bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration: underline; } + +hr { + color:#cccccc; + background: #00007f; + height: 1px; +} + +blockquote { margin-left: 3em; } + +ul { list-style-type: disc; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; +} + +pre { + background-color: rgb(245, 245, 245); + border: 1px solid #C0C0C0; /* silver */ + padding: 10px; + margin: 10px 0 10px 0; + overflow: auto; + font-family: "Andale Mono", monospace; +} + +pre.example { + font-size: .85em; +} + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 14em; + vertical-align: top; + background-color: #f0f0f0; + overflow: visible; +} + +#navigation h2 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; +} + +#navigation li li a { + margin: 0px 3px 0px -1em; +} + +#content { + margin-left: 14em; + padding: 1em; + width: 700px; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight: bold; color: #004080; text-decoration: underline; } + + #main { + background-color: #ffffff; + border-left: 0px; + } + + #container { + margin-left: 2%; + margin-right: 2%; + background-color: #ffffff; + } + + #content { + padding: 1em; + background-color: #ffffff; + } + + #navigation { + display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.module_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.module_list td.summary { width: 100%; } + + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.function_list td.summary { width: 100%; } + +ul.nowrap { + overflow:auto; + white-space:nowrap; +} + +dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} +dl.table h3, dl.function h3 {font-size: .95em;} + +/* stop sublists from having initial vertical space */ +ul ul { margin-top: 0px; } +ol ul { margin-top: 0px; } +ol ol { margin-top: 0px; } +ul ol { margin-top: 0px; } + +/* make the target distinct; helps when we're navigating to a function */ +a:target + * { + background-color: #FF9; +} + + +/* styles for prettification of source */ +pre .comment { color: #558817; } +pre .constant { color: #a8660d; } +pre .escape { color: #844631; } +pre .keyword { color: #aa5050; font-weight: bold; } +pre .library { color: #0e7c6b; } +pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } +pre .string { color: #8080ff; } +pre .number { color: #f8660d; } +pre .operator { color: #2239a8; font-weight: bold; } +pre .preprocessor, pre .prepro { color: #a33243; } +pre .global { color: #800080; } +pre .user-keyword { color: #800080; } +pre .prompt { color: #558817; } +pre .url { color: #272fc2; text-decoration: underline; } + diff --git a/modules/launchdarkly-server-sdk-redis.html b/modules/launchdarkly-server-sdk-redis.html new file mode 100644 index 0000000..b28f67a --- /dev/null +++ b/modules/launchdarkly-server-sdk-redis.html @@ -0,0 +1,125 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module launchdarkly-server-sdk-redis

+

Server-side SDK for LaunchDarkly Redis store.

+

+ + +

Functions

+ + + + + +
makeStore (fields)Initialize a store backend
+ +
+
+ + +

Functions

+ +
+
+ + makeStore (fields) +
+
+ Initialize a store backend + + +

Parameters:

+
    +
  • fields list of configuration options +
      +
    • host + string + Hostname for Redis. + (optional) +
    • +
    • port + int + Port for Redis. + (optional) +
    • +
    • prefix + string + Redis key prefix for SDK values. + (optional) +
    • +
    • poolSize + int + Number of Redis connections to maintain. + (optional) +
    • +
    +
+ +

Returns:

+
    + + A fresh Redis store backend. +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2023-12-18 22:51:07 +
+
+ + diff --git a/modules/launchdarkly-server-sdk.html b/modules/launchdarkly-server-sdk.html new file mode 100644 index 0000000..5a56c53 --- /dev/null +++ b/modules/launchdarkly-server-sdk.html @@ -0,0 +1,952 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module launchdarkly-server-sdk

+

Server-side SDK for LaunchDarkly.

+

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
registerLogger (logLevel, cb)Set the global logger for all SDK operations.
makeUser (fields)Create a new opaque user object.
version ()Return SDK version.
makeClient (config, backend[, timeoutMilliseconds])Initialize a new client, and connect to LaunchDarkly.
boolVariation (user, key, fallback)Evaluate a boolean flag
boolVariationDetail (user, key, fallback)Evaluate a boolean flag and return an explanation
intVariation (user, key, fallback)Evaluate an integer flag
intVariationDetail (user, key, fallback)Evaluate an integer flag and return an explanation
doubleVariation (user, key, fallback)Evaluate a double flag
doubleVariationDetail (user, key, fallback)Evaluate a double flag and return an explanation
stringVariation (user, key, fallback)Evaluate a string flag
stringVariationDetail (user, key, fallback)Evaluate a string flag and return an explanation
jsonVariation (user, key, fallback)Evaluate a json flag
jsonVariationDetail (user, key, fallback)Evaluate a json flag and return an explanation
flush ()Immediately flushes queued events.
track (key, user[, data[, metric]])Reports that a user has performed an event.
alias (currentUser, previousUser)Associates two users for analytics purposes by generating an alias event.
isInitialized ()Check if a client has been fully initialized.
identify (user)Generates an identify event for a user.
allFlags (user)Returns a map from feature flag keys to values for a given user.
+ +
+
+ + +

Functions

+ +
+
+ + registerLogger (logLevel, cb) +
+
+ Set the global logger for all SDK operations. This function is not thread +safe, and if used should be done so before other operations. The default +log level is "INFO". + + +

Parameters:

+
    +
  • logLevel + string + The level to at. Available options are: +"FATAL", "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE". +
  • +
  • cb + function + The logging handler. Callback must be of the form +"function (logLevel, logLine) ... end". +
  • +
+ + + + + +
+
+ + makeUser (fields) +
+
+ Create a new opaque user object. + + +

Parameters:

+
    +
  • fields list of user fields. +
      +
    • key + string + The user's key +
    • +
    • anonymous + boolean + Mark the user as anonymous + (optional) +
    • +
    • ip + string + Set the user's IP + (optional) +
    • +
    • firstName + string + Set the user's first name + (optional) +
    • +
    • lastName + string + Set the user's last name + (optional) +
    • +
    • email + string + Set the user's email + (optional) +
    • +
    • name + string + Set the user's name + (optional) +
    • +
    • avatar + string + Set the user's avatar + (optional) +
    • +
    • country + string + Set the user's country + (optional) +
    • +
    • secondary + string + Set the user's secondary key + (optional) +
    • +
    • privateAttributeNames + table + A list of attributes to +redact + (optional) +
    • +
    • custom + table + Set the user's custom JSON + (optional) +
    • +
    +
+ +

Returns:

+
    + + an opaque user object +
+ + + + +
+
+ + version () +
+
+ Return SDK version. + + + +

Returns:

+
    + + SDK version string. +
+ + + + +
+
+ + makeClient (config, backend[, timeoutMilliseconds]) +
+
+ Initialize a new client, and connect to LaunchDarkly. Applications should instantiate a single instance for the lifetime of their application. + + +

Parameters:

+
    +
  • config list of configuration options +
      +
    • key + string + Environment SDK key +
    • +
    • baseURI + string + Set the base URI for connecting to +LaunchDarkly. You probably don't need to set this unless instructed by +LaunchDarkly. + (optional) +
    • +
    • streamURI + string + Set the streaming URI for connecting to +LaunchDarkly. You probably don't need to set this unless instructed by +LaunchDarkly. + (optional) +
    • +
    • eventsURI + string + Set the events URI for connecting to +LaunchDarkly. You probably don't need to set this unless instructed by +LaunchDarkly. + (optional) +
    • +
    • stream + boolean + 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. + (optional) +
    • +
    • sendEvents + string + 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. + (optional) +
    • +
    • eventsCapacity + int + 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. + (optional) +
    • +
    • timeout + int + The connection timeout to use when making +requests to LaunchDarkly. + (optional) +
    • +
    • flushInterval + int + he time between flushes of the event +buffer. Decreasing the flush interval means that the event buffer is less +likely to reach capacity. + (optional) +
    • +
    • pollInterval + int + The polling interval +(when streaming is disabled) in milliseconds. + (optional) +
    • +
    • offline + boolean + 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. + (optional) +
    • +
    • allAttributesPrivate + boolean + 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. + (optional) +
    • +
    • inlineUsersInEvents + boolean + Set to true if you need to +see the full user details in every analytics event. + (optional) +
    • +
    • userKeysCapacity + int + 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. + (optional) +
    • +
    • userKeysFlushInterval + int + The interval at which the event +processor will reset its set of known user keys, in milliseconds. + (optional) +
    • +
    • privateAttributeNames + table + Marks a set of user attribute +names private. Any users sent to LaunchDarkly with this configuration active +will have attributes with these names removed. + (optional) +
    • +
    +
  • backend + config.featureStoreBackend Persistent feature store +backend. + (optional) +
  • +
  • timeoutMilliseconds + int + How long to wait for flags to +download. If the timeout is reached a non fully initialized client will be +returned. +
  • +
+ +

Returns:

+
    + + A fresh client. +
+ + + + +
+
+ + boolVariation (user, key, fallback) +
+
+ Evaluate a boolean flag + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + boolean + The value to return on error +
  • +
+ +

Returns:

+
    + + boolean + The evaluation result, or the fallback value +
+ + + + +
+
+ + boolVariationDetail (user, key, fallback) +
+
+ Evaluate a boolean flag and return an explanation + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + boolean + The value to return on error +
  • +
+ +

Returns:

+
    + + table + The evaluation explanation +
+ + + + +
+
+ + intVariation (user, key, fallback) +
+
+ Evaluate an integer flag + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + int + The value to return on error +
  • +
+ +

Returns:

+
    + + int + The evaluation result, or the fallback value +
+ + + + +
+
+ + intVariationDetail (user, key, fallback) +
+
+ Evaluate an integer flag and return an explanation + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + int + The value to return on error +
  • +
+ +

Returns:

+
    + + table + The evaluation explanation +
+ + + + +
+
+ + doubleVariation (user, key, fallback) +
+
+ Evaluate a double flag + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + number + The value to return on error +
  • +
+ +

Returns:

+
    + + double + The evaluation result, or the fallback value +
+ + + + +
+
+ + doubleVariationDetail (user, key, fallback) +
+
+ Evaluate a double flag and return an explanation + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + number + The value to return on error +
  • +
+ +

Returns:

+
    + + table + The evaluation explanation +
+ + + + +
+
+ + stringVariation (user, key, fallback) +
+
+ Evaluate a string flag + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + string + The value to return on error +
  • +
+ +

Returns:

+
    + + string + The evaluation result, or the fallback value +
+ + + + +
+
+ + stringVariationDetail (user, key, fallback) +
+
+ Evaluate a string flag and return an explanation + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + string + The value to return on error +
  • +
+ +

Returns:

+
    + + table + The evaluation explanation +
+ + + + +
+
+ + jsonVariation (user, key, fallback) +
+
+ Evaluate a json flag + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + table + The value to return on error +
  • +
+ +

Returns:

+
    + + table + The evaluation result, or the fallback value +
+ + + + +
+
+ + jsonVariationDetail (user, key, fallback) +
+
+ Evaluate a json flag and return an explanation + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
  • key + string + The key of the flag to evaluate. +
  • +
  • fallback + table + The value to return on error +
  • +
+ +

Returns:

+
    + + table + The evaluation explanation +
+ + + + +
+
+ + flush () +
+
+ Immediately flushes queued events. + + + +

Returns:

+
    + + nil + +
+ + + + +
+
+ + track (key, user[, data[, metric]]) +
+
+ Reports that a user has performed an event. Custom data, and a metric +can be attached to the event as JSON. + + +

Parameters:

+
    +
  • key + string + The name of the event +
  • +
  • user + user + An opaque user object from makeUser +
  • +
  • data + table + A value to be associated with an event + (optional) +
  • +
  • metric + number + A value to be associated with an event + (optional) +
  • +
+ +

Returns:

+
    + + nil + +
+ + + + +
+
+ + alias (currentUser, previousUser) +
+
+ Associates two users for analytics purposes by generating an alias event. + + +

Parameters:

+
    +
  • currentUser + user + An opaque user object from makeUser +
  • +
  • previousUser + user + An opaque user object from makeUser +
  • +
+ +

Returns:

+
    + + nil + +
+ + + + +
+
+ + isInitialized () +
+
+ Check if a client has been fully initialized. This may be useful if the +initialization timeout was reached. + + + +

Returns:

+
    + + boolean + true if fully initialized +
+ + + + +
+
+ + identify (user) +
+
+ Generates an identify event for a user. + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
+ +

Returns:

+
    + + nil + +
+ + + + +
+
+ + allFlags (user) +
+
+ Returns a map from feature flag keys to values for a given user. +This does not send analytics events back to LaunchDarkly. + + +

Parameters:

+
    +
  • user + user + An opaque user object from makeUser +
  • +
+ +

Returns:

+
    + + table + +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2023-12-18 22:51:07 +
+
+ +