> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Node.js (server-side) SDK

<View title="Developer" />

<View title="Federal docs" />

<View title="EU docs" />

<View title="Federal docs">
  <Danger>
    **LaunchDarkly onboarding is not available in federal environments**

    To learn more, read <a href="/docs/home/infrastructure/federal">LaunchDarkly in federal environments</a>.
  </Danger>
</View>

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

## Install the package

<CodeGroup>
  ```shell title="yarn" lines wrap theme={null}
  yarn add @launchdarkly/node-server-sdk
  ```

  ```shell title="npm" lines wrap theme={null}
  npm i @launchdarkly/node-server-sdk
  ```

  ```shell title="pnpm" lines wrap theme={null}
  pnpm i @launchdarkly/node-server-sdk
  ```
</CodeGroup>

### Initialize the SDK

```tsx title="Node.js (server-side) SDK initialization" lines wrap theme={null}
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!');
});
```

<Accordion title="Finding your SDK credentials">
  You can find your server-side SDK keys, mobile keys, and client-side ID on the **SDK keys** page under **Settings**.
</Accordion>

To learn more, read [Initialize the client](/docs/sdk/server-side/node-js#initialize-the-client) in the Node.js (server-side) SDK reference guide.
