> ## 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.

# React Native SDK observability reference

> This topic documents how to get started with the LaunchDarkly observability plugin for the React Native SDK.

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

<Note title="This LaunchDarkly observability plugin is available for early access">
  This LaunchDarkly observability plugin is currently available in Early Access, and APIs are subject to change until a 1.x version is released.
</Note>

## Overview

This topic documents how to get started with the LaunchDarkly observability plugin for the React Native SDK.

The React Native SDK supports the **observability plugin** for error monitoring, logging, and tracing.

<Note title="SDK quick links">
  LaunchDarkly's SDKs are open source. In addition to this reference guide, we provide source, API reference documentation, and a sample application:
</Note>

| Resource | Location |
| - | - |
| SDK API documentation | [Observability plugin API docs](https://launchdarkly.github.io/observability-sdk/sdk/@launchdarkly/observability-react-native/) |
| GitHub repository | [@launchdarkly/observability-react-native](https://github.com/launchdarkly/observability-sdk/tree/main/sdk/%40launchdarkly/observability-react-native) |
| Published module | [npm](https://www.npmjs.com/package/@launchdarkly/observability-react-native) |

## Prerequisites and dependencies

This reference guide assumes you are familiar with the LaunchDarkly [React Native SDK](/sdk/client-side/react/react-native).

The observability plugin requires React Native SDK version 10.10.0 or later.

The React Native SDK version 10.x is compatible with Expo. Only iOS and Android platforms are supported. Web is not supported. The React Native SDK v10.x is compatible with React Native 0.72, 0.73, 0.74, 0.76, and with Expo 51, Expo

52. Not all React Native and Expo versions have been tested with the observability plugin, as it is still in Early Access.

## Get started

Follow these steps to get started:

* [Install the plugin](#install-the-plugin)
* [Initialize the React Native SDK client](#initialize-the-client)
* [Configure the plugin options](#configure-the-plugin-options)
* [Explore supported features](#explore-supported-features)
* [Review observability data in LaunchDarkly](#review-observability-data-in-launchdarkly)

## Install the plugin

LaunchDarkly uses a plugin to the React Native SDK to provide observability.

The first step is to make both the SDK and the observability plugin available as dependencies.

Here's how:

<CodeGroup>
  ```bash title="npm, React Native SDK v10.10+" theme={null}
       npm install @launchdarkly/react-native-client-sdk
       npm install @launchdarkly/observability-react-native
  ```

  ```bash title="yarn, React Native SDK v10.10+" theme={null}
      yarn add @launchdarkly/react-native-client-sdk
      yarn add @launchdarkly/observability-react-native
  ```
</CodeGroup>

Then, import the plugin into your code:

<CodeGroup>
  ```js title="Import, React Native SDK v10.10+" theme={null}
      import { ReactNativeLDClient } from '@launchdarkly/react-native-client-sdk';
      import { Observability, LDObserve } from '@launchdarkly/observability-react-native';
  ```
</CodeGroup>

## Initialize the client

Next, initialize the SDK and the plugin.

To initialize, you need your LaunchDarkly environment's mobile key. This authorizes your application to connect to a particular environment within LaunchDarkly. To learn more, read [Initialize the client and identify a context](/sdk/client-side/react/react-native#initialize-the-client-and-identify-a-context) in the React Native SDK reference guide.

<Warning title="React Native observability SDK credentials">
  The React Native observability SDK uses a mobile key. Keys are specific to each project and environment. They are available from **Project settings**, on the **Environments** list. To learn more about key types, read [Keys](/sdk/concepts/client-side-server-side#keys).

  Mobile keys are not secret and you can expose them in your client-side code without risk. However, never embed a server-side SDK key into a client-side application.
</Warning>

Here's how to initialize the SDK and plugin:

<CodeGroup>
  ```js title="Initialize, React Native SDK v10.10+" theme={null}
      const client = new ReactNativeLDClient(
          'example-mobile-key',
          AutoEnvAttributes.Enabled,
          {
            plugins: [
              new Observability()
            ],
          }
      );
  ```
</CodeGroup>

## Configure the plugin options

You can configure options for the observability plugin when you initialize the SDK. The plugin constructor takes an optional object with the configuration details.

Here is an example:

<CodeGroup>
  ```js title="Plugin options, React Native SDK v10.10+" theme={null}
      const client = new ReactNativeLDClient(
          'example-mobile-key',
          AutoEnvAttributes.Enabled,
          {
            plugins: [
              new Observability({
                serviceName: 'example-service',
                // we recommend setting service_version to the latest deployed git SHA
                serviceVersion: 'example-sha'
              })
            ],
          }
      );
  ```
</CodeGroup>

For more information on plugin options, read [Configuration for client-side observability](/sdk/features/observability-config-client-side).

## Explore supported features

The observability plugin supports the following features. After the SDK and plugins are initialized, you can access these from within your application:

* [Configuration for client-side observability](/sdk/features/observability-config-client-side)
* [Errors](/sdk/features/observability-errors#react-native)
* [Logs](/sdk/features/observability-logs#react-native)
* [Metrics](/sdk/features/observability-metrics#react-native)
* [Tracing](/sdk/features/observability-traces#react-native)

## Review observability data in LaunchDarkly

After you initialize the SDK and observability plugin, your application automatically starts sending observability data back to LaunchDarkly, including errors and logs. You can review this information in the LaunchDarkly user interface. To learn how, read [Observability](/home/observability).
