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.
3. If your application does not already have its own dependency on the `aws-sdk` package, and if it will _not_ be running in AWS Lambda, add `aws-sdk` as well:
24
+
25
+
npm install aws-sdk --save
26
+
27
+
The `launchdarkly-node-server-sdk-dynamodb` package does not provide `aws-sdk` as a transitive dependency, because it is provided automatically by the Lambda runtime and this would unnecessarily increase the size of applications deployed in Lambda. Therefore, if you are not using Lambda you need to provide `aws-sdk` separately.
28
+
29
+
4. Require the package:
24
30
25
31
var DynamoDBFeatureStore = require('launchdarkly-node-server-sdk-dynamodb');
26
32
27
-
4. When configuring your SDK client, add the DynamoDB feature store:
33
+
5. When configuring your SDK client, add the DynamoDB feature store:
28
34
29
35
var store = DynamoDBFeatureStore('YOUR TABLE NAME');
30
36
var config = { featureStore: store };
@@ -39,12 +45,12 @@ This assumes that you have already installed the LaunchDarkly Node.js SDK.
39
45
40
46
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { dynamoDBClient: myDynamoDBClientInstance });
41
47
42
-
5. 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:
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:
43
49
44
50
var config = { featureStore: store, useLdd: true };
45
51
var client = LaunchDarkly.init('YOUR SDK KEY', config);
46
52
47
-
6. 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:
53
+
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:
48
54
49
55
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { prefix: 'env1' });
0 commit comments