Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit e49fe8d

Browse files
authored
Merge pull request #14 from launchdarkly/eb/ch71086/aws-peer-dep
move aws-sdk to peer dependencies
2 parents 153c4c0 + 67b9170 commit e49fe8d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ This assumes that you have already installed the LaunchDarkly Node.js SDK.
2020

2121
npm install launchdarkly-node-server-sdk-dynamodb --save
2222

23-
3. Require the package:
23+
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:
2430

2531
var DynamoDBFeatureStore = require('launchdarkly-node-server-sdk-dynamodb');
2632

27-
4. When configuring your SDK client, add the DynamoDB feature store:
33+
5. When configuring your SDK client, add the DynamoDB feature store:
2834

2935
var store = DynamoDBFeatureStore('YOUR TABLE NAME');
3036
var config = { featureStore: store };
@@ -39,12 +45,12 @@ This assumes that you have already installed the LaunchDarkly Node.js SDK.
3945

4046
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { dynamoDBClient: myDynamoDBClientInstance });
4147

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:
4349

4450
var config = { featureStore: store, useLdd: true };
4551
var client = LaunchDarkly.init('YOUR SDK KEY', config);
4652

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:
4854

4955
var store = DynamoDBFeatureStore('YOUR TABLE NAME', { prefix: 'env1' });
5056

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"devDependencies": {
1414
"@babel/core": "7.4.3",
1515
"@babel/preset-env": "7.4.3",
16+
"aws-sdk": "^2.349.0",
1617
"babel-jest": "24.7.1",
1718
"eslint": "5.8.0",
1819
"eslint-formatter-pretty": "1.3.0",
@@ -32,11 +33,11 @@
3233
"transformIgnorePatterns": []
3334
},
3435
"dependencies": {
35-
"aws-sdk": "2.349.0",
3636
"node-cache": "4.2.0",
3737
"winston": "2.4.1"
3838
},
3939
"peerDependencies": {
40+
"aws-sdk": "^2.349.0",
4041
"launchdarkly-node-server-sdk": ">= 5.8.1"
4142
},
4243
"engines": {

0 commit comments

Comments
 (0)