Giter Site home page Giter Site logo

launchdarkly / node-server-sdk-dynamodb Goto Github PK

View Code? Open in Web Editor NEW
4.0 43.0 5.0 263 KB

DynamoDB integration for the LaunchDarkly SDK for Server-side Node.js

License: Other

JavaScript 97.17% TypeScript 2.83%
launchdarkly launchdarkly-sdk-component node nodejs node-js dynamodb managed-by-terraform feature-flags feature-toggles launchdarkly-sdk

node-server-sdk-dynamodb's Issues

Ignore documents bigger than 400KB

Is it possible to automatically ignore documents which are greater than 400KB in size?

This would not break synchronization process.

I can create a PR if you will accept it

LD Client with DynamoDBFeatureStore fails with 'cannot read property error from undefined' on any error with DynamoDB

Hey! I am trying to adopt LD in AWS Serverless and trying to use DynamoDBFeatureStore and found a little issue there.

If there is any error with DymamoDB (like lack of permissions or not such table) I receive crash from LD CLient with cannot read property error from undefined message.

After some investigation I found out that:

  1. config (DynamoDBFeatureStore(...)(config)) is LDOptions
  2. LDOptions does not require logger
  3. But DynamoDBFeatureStore actually requires it.
  4. So if anything bad happens (like here), SDK will just crash.

My assumption that logger should not be required in DynamoDBFeatureStore (it might be default to something like console perhaps).

I might be wrong as well, and it would be nice if someone explains this behavior to me)

Thanks for looking into it :)

Support for @aws-sdk v3

aws-sdk has gone into maintenance mode as of 2023 and will not be receiving new updates. We are looking to migrate all of our existing uses into @AWS-SDK v3 clients which helps reduce our bundle size while running on Node20 lambdas as the sdk v2 is no longer provided by default it now has to be installed in each of our packages and increases our bundles.

I tried to update our launchdarkly package wrapper and noticed when trying to pass sdk v3 DocumentClient into launchdarkly-node-server-sdk-dynamodb it won't accept it because it's only accepting the type from sdk v2

dynamoDBClient?: DynamoDB.DocumentClient; which is defined here: https://github.com/launchdarkly/node-server-sdk-dynamodb/blob/main/index.d.ts#L55

Ideally we would be able to provide appropriate classes for aws-sdk v3 instead of only using v2.

NPM bundle is kinda on the huge side

We are using this package in a lambda (as might be a pretty common use case for using DynamoDB as a flag store).

When this package is included it adds nearly 100MB to the lambda bundle.

Half of that is because it ships the AWS SDK as a required dep, which maybe be moved to a peerDep, unless you think the specific version you are using is critical to stability.

The other half is becuase typedoc is also shipped as a required dep. Seems like that could be moved to a devDep since I'm assuming it is used to generate your documentation, and not part of the production executed library.

We had one of our lambdas tip over the size limit when we included this package.

Typescript definitions are wrong

The current TypeScript definitions throw type errors when the package is imported.

When imported as such:

import DynamoDBFeatureStore from 'launchdarkly-node-server-sdk-dynamodb'

The following type error is emitted from the compiler:

Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("launchdarkly-node-server-sdk-dynamodb")' has no compatible call signatures.

This is because the default import has not been properly tagged, and so typescript thinks that DynamoDBFeatureStore is a named import and wants you to import like so:

import { DynamoDBFeatureStore } from 'launchdarkly-node-server-sdk-dynamodb'

But then at run time, this throws an error because that named import does not actually exist.

Required DynamoDB permissions for `feature store` and `big segments`

Hi LaunchDarkly team,

Our team is so keen to know which DynamoDB permissions are required in our infrastructure in order to benefit from feature store and big segments in Node SDK. Would you be able to elaborate on this or steer me to the right documents or more info, please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.