Set up Node.js (server-side) SDK

Install and initialize the LaunchDarkly Node.js (server-side) SDK to start evaluating feature flags in your application.

Install the package

yarn add @launchdarkly/node-server-sdk

Initialize the SDK

Node.js (server-side) SDK initialization
import * as LaunchDarkly from '@launchdarkly/node-server-sdk';
// This is your LaunchDarkly SDK key.
// Never hardcode your SDK key in production.
const client = LaunchDarkly.init('YOUR_SDK_KEY');
client.once('ready', function () {
// For onboarding purposes only we flush events as soon as
// possible so we quickly detect your connection.
// You don't have to do this in practice because events are automatically flushed.
client.flush();
console.log('SDK successfully initialized!');
});

You can find your server-side SDK keys, mobile keys, and client-side ID on the SDK keys page under Settings.

To learn more, read Initialize the client in the Node.js (server-side) SDK reference guide.