Node.js (server-side) SDK 7.x to 8.0 migration guide
Node.js (server-side) SDK 7.x to 8.0 migration guide
Node.js (server-side) SDK 7.x to 8.0 migration guide
This topic summarizes changes and explains how to adapt code that uses a 7.x version of the Node.js (server-side) SDK to use version 8.0 or later.
Version 8.0 includes several breaking changes.
Before you migrate to version 8.0, update to the latest 7.x version. Some of the changes that are mandatory in 8.0 were originally added in a 7.x version and made optional.
@launchdarkly/node-server-sdkIn version 8.0, we’ve introduced @launchdarkly/node-server-sdk as a replacement for launchdarkly-node-server-sdk.
In this new package, the Node.js (server-side) SDK:
Most of the API has remained compatible with version 7.x.
The 8.0 version of the SDK is compatible with Node.js versions 14 and higher. LaunchDarkly no longer supports older Node.js versions, as is documented in the End of Life policy.
LaunchDarkly also no longer supports some Node.js versions above 14 that are not long-term-support versions and have reached their end of life. To learn more, read the Node.js releases page.
The userKeysCapacity and userKeysFlushInterval were deprecated in 7.x and removed in 8.0. Use contextKeysCapacity and contextKeysFlushInterval instead.
The proxyHost, proxyPort, and proxyAuth options were removed in 8.0. Use proxyOptions instead.
Here’s how:
To learn more, read Web proxy configuration.
The Redis integration package has a new repository and package.
Node.js (server-side) SDK 8.0 does not work with the 2.x or earlier version of the integration. It requires @launchdarkly/node-server-sdk-redis version 3.0 or higher.
In version 3.0 and higher of the Node.js SDK Redis integration, the ioredis package is used for Redis operations.
In version 3.0 the redisOpts setting of LDRedisOptions is the RedisOptions type from ioredis. If you were using this option, then be sure to migrate your redis settings to ioredis settings.
In version 3.0 the client setting of LDRedisOptions is the Redis type from ioredis. If you were using this option, then be sure to create an ioredis client instead of a redis client.
Basic configuration of the Redis integration:
The DynamoDB integration package has a new repository and package.
Node.js (server-side) SDK 8.0 does not work with the 4.x or earlier version of the integration. It requires @launchdarkly/node-server-sdk-dynamodb version 5.0 or higher.
In version 5.0 and higher of the Node.js SDK DynamoDB integration, the AWS SDK for JavaScript v3 package is used for DynamoDB operations.
In version 5.0 the clientOptions setting of LDDynamoDBOptions is the DynamoDBClientConfig from @aws-sdk/client-dynamodb. If you were using this options, then be sure to migrate your settings to those used in the AWS SDK for JavaScript v3.
In version 5.0 the dynamoDBClient setting of LDDynamoDBOptions is the DynamoDBClient from @aws-sdk/client-dynamodb. If you were using this options, then be sure to migrate your client the version from the AWS SDK for JavaScript v3.
Basic configuration of the DynamoDB integration:
In v8.0 the API for TestData has changed:
new.getFactory, to get the updated processor factory.Here’s how:
In v8.0 the API for FileDataSource API has changed:
new.getFactory, to get the updated processor factory.Here’s how: