Skip to content

Commit 7c35e5c

Browse files
authored
chore: DynamoDB readme corrections. (#242)
1 parent 243729d commit 7c35e5c

File tree

1 file changed

+8
-8
lines changed
  • packages/store/node-server-sdk-dynamodb

1 file changed

+8
-8
lines changed

packages/store/node-server-sdk-dynamodb/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Refer to [Using DynamoDB as a persistent feature store](https://docs.launchdarkl
2727

2828
2. Install this package with `npm` or `yarn`:
2929

30-
`npm install launchdarkly-node-server-sdk-dynamodb --save`
30+
`npm install @launchdarkly/node-server-sdk-dynamodb --save`
3131

3232
3. If your application does not already have its own dependency on the `@aws-sdk/client-dynamodb` package, and if it will _not_ be running in AWS Lambda, add `@aws-sdk/client-dynamodb` as well:
3333

@@ -38,28 +38,28 @@ The `launchdarkly-node-server-sdk-dynamodb` package does not provide `@aws-sdk/c
3838
4. Import the package:
3939

4040
```typescript
41-
const { DynamoDBFeatureStoreFactory } = require('launchdarkly-node-server-sdk-dynamodb');
41+
const { DynamoDBFeatureStore } = require('launchdarkly-node-server-sdk-dynamodb');
4242
```
4343

4444
5. When configuring your SDK client, add the DynamoDB feature store:
4545

4646
```typescript
47-
const store = DynamoDBFeatureStoreFactory('YOUR TABLE NAME');
47+
const store = DynamoDBFeatureStore('YOUR TABLE NAME');
4848
const config = { featureStore: store };
4949
const client = LaunchDarkly.init('YOUR SDK KEY', config);
5050
```
5151

5252
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:
5353

5454
```typescript
55-
const dynamoDBOptions = { accessKeyId: 'YOUR KEY', secretAccessKey: 'YOUR SECRET' };
56-
const store = DynamoDBFeatureStoreFactory('YOUR TABLE NAME', { clientOptions: dynamoDBOptions });
55+
const dynamoDBOptions = { credentials: { accessKeyId: 'YOUR KEY', secretAccessKey: 'YOUR SECRET' }};
56+
const store = DynamoDBFeatureStore('YOUR TABLE NAME', { clientOptions: dynamoDBOptions });
5757
```
5858

5959
Alternatively, if you already have a fully configured DynamoDB client object, you can tell LaunchDarkly to use that:
6060

6161
```typescript
62-
const store = DynamoDBFeatureStoreFactory('YOUR TABLE NAME', {
62+
const store = DynamoDBFeatureStore('YOUR TABLE NAME', {
6363
dynamoDBClient: myDynamoDBClientInstance,
6464
});
6565
```
@@ -74,15 +74,15 @@ const client = LaunchDarkly.init('YOUR SDK KEY', config);
7474
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:
7575

7676
```typescript
77-
const store = DynamoDBFeatureStoreFactory('YOUR TABLE NAME', { prefix: 'env1' });
77+
const store = DynamoDBFeatureStore('YOUR TABLE NAME', { prefix: 'env1' });
7878
```
7979

8080
## Caching behavior
8181

8282
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:
8383

8484
```typescript
85-
const factory = DynamoDBFeatureStoreFactory({ cacheTTL: 0 });
85+
const factory = DynamoDBFeatureStore({ cacheTTL: 0 });
8686
```
8787

8888
## Contributing

0 commit comments

Comments
 (0)