Identifying Node.js versions for the 2.0 SDK
The 1.x version of the SDK is compatible with Node.js versions 12 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 12 that are not long-term-support versions and have reached their end of life. To learn more, read the Node.js releases page.Understanding changes to dependencies
The SDK no longer has a dependency on thewinston logging package. You can still use winston, but the SDK does not load it by default. To learn more, read Understanding changes to logging.
Understanding changes to logging
Previously, if you did not specify your own logger in thelogger property, the SDK used winston to create a logger.
In versions 2.0 and higher of the SDK, if you do not specify your own logger, the SDK writes log output directly to the console. It uses the same format that it was previously using with winston, so you may not notice any difference.
If you want to use winston, you can still create a winston logger and put it in the SDK’s logger property. This works exactly the same as before. The only difference is that you must make sure winston exists as a dependency in your project, instead of the dependency being provided automatically by the SDK.
The SDK also has a new option to allow configuring a simple logger without using winston. To learn more, read basicLogger. This replaces the previous createConsoleLogger, which had slightly different parameters. If you were calling ld.createConsoleLogger('warn'), you would change that to ld.basicLogger({ level: 'warn' }).