You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
This library provides a DynamoDB-backed persistence mechanism (feature store) for the [LaunchDarkly Node.js SDK](https://github.com/launchdarkly/node-server-sdk), replacing the default in-memory feature store. It uses the AWS SDK for Node.js.
6
6
7
-
The minimum version of the LaunchDarkly Node.js SDK for use with this library is 6.0.0.
7
+
The minimum version of the LaunchDarkly Node.js SDK for use with this library is 6.2.0.
8
8
9
9
For more information, see the [SDK features guide](https://docs.launchdarkly.com/sdk/features/database-integrations).
10
10
@@ -28,37 +28,37 @@ This assumes that you have already installed the LaunchDarkly Node.js SDK.
28
28
29
29
4. Require the package:
30
30
31
-
var DynamoDBFeatureStore = require('launchdarkly-node-server-sdk-dynamodb');
By default, the DynamoDB client will try to get your AWS credentials and region name from environment variables and/or local configuration files, as described in the AWS SDK documentation. You can also specify any valid [DynamoDB client options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#constructor-property) like this:
const store = DynamoDBFeatureStore('YOUR TABLE NAME', { clientOptions: dynamoDBOptions });
43
43
44
44
Alternatively, if you already have a fully configured DynamoDB client object, you can tell LaunchDarkly to use that:
45
45
46
-
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { dynamoDBClient: myDynamoDBClientInstance });
46
+
const store = DynamoDBFeatureStore('YOUR TABLE NAME', { dynamoDBClient: myDynamoDBClientInstance });
47
47
48
48
6. If you are running a [LaunchDarkly Relay Proxy](https://github.com/launchdarkly/ld-relay) instance, or any other process that will prepopulate the DynamoDB table with feature flags from LaunchDarkly, you can use [daemon mode](https://github.com/launchdarkly/ld-relay#daemon-mode), so that the SDK retrieves flag data only from DynamoDB and does not communicate directly with LaunchDarkly. This is controlled by the SDK's `useLdd` option:
49
49
50
-
var config = { featureStore: store, useLdd: true };
51
-
var client = LaunchDarkly.init('YOUR SDK KEY', config);
7. If the same DynamoDB table is being shared by SDK clients for different LaunchDarkly environments, set the `prefix` option to a different short string for each one to keep the keys from colliding:
54
54
55
-
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { prefix: 'env1' });
55
+
const store = DynamoDBFeatureStore('YOUR TABLE NAME', { prefix: 'env1' });
56
56
57
57
## Caching behavior
58
58
59
59
To reduce traffic to DynamoDB, there is an optional in-memory cache that retains the last known data for a configurable amount of time. This is on by default; to turn it off (and guarantee that the latest feature flag data will always be retrieved from DynamoDB for every flag evaluation), configure the store as follows:
60
60
61
-
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { cacheTTL: 0 });
61
+
const store = DynamoDBFeatureStore('YOUR TABLE NAME', { cacheTTL: 0 });
0 commit comments