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

# Set up React Web SDK

> Install and initialize the LaunchDarkly React Web SDK

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

<div>
  <ReadmeButton sdk={SDK.React} />

  <CursorButton sdk={SDK.React} />
</div>

### Install the package

<CodeGroup>
  ```shell title={"yarn"} theme={null}
    yarn add launchdarkly-react-client-sdk

  ```

  ```shell title={"npm"} theme={null}
    npm i launchdarkly-react-client-sdk

  ```

  ```shell title={"pnpm"} theme={null}
    pnpm i launchdarkly-react-client-sdk

  ```
</CodeGroup>

### Initialize the SDK

```tsx title={"React Web SDK initialization"} theme={null}
// Add the code below to the root of your React app.
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { LDProvider } from 'launchdarkly-react-client-sdk';

function App() {
  return <div>Let your feature flags fly!</div>
}

// A "context" is a data object representing users, devices, organizations, and other entities.
const context = {
  kind: 'user',
  key: 'EXAMPLE_CONTEXT_KEY',
  email: 'biz@face.dev',
};

// The clientSideID is your SDK key.
// This value is automatically retrieved from LaunchDarkly.
createRoot(document.getElementById('root') as HTMLElement).render(
  <StrictMode>
    <LDProvider clientSideID="YOUR_CLIENT_SIDE_ID" context={context}>
      <App />
    </LDProvider>
  </StrictMode>,
);

```

<Accordion title="Finding your SDK credentials">
  You can find your server-side SDK key, client-side ID, and mobile key in the "Resources" section of the help menu. Click the **help icon** at the bottom left corner of the LaunchDarkly UI, then choose **SDK keys**:

  <Frame caption="The SDK keys option in the help menu.">
    ![The SDK keys option in the help menu.](https://files.buildwithfern.com/https://launchdarkly.docs.buildwithfern.com/docs/28d3e1c568378ea02528db7ba62bfbd742f6f1cad964b5675395e10af5eeeb60/assets/images/auto/help-menu-sdk-keys.auto.png)
  </Frame>
</Accordion>

To learn more, read [Initialize the client](/sdk/client-side/react/react-web#initialize-the-client) in the React Web SDK reference guide.
