React Native SDK Installation

Important

  • React Native versions earlier than 0.64 are not supported.
  • The Clarity package depends on native code to run, therefore you've to ship a new build after integrating the package.
  • Expo Go does not support plugins that require native code to execute. Hence, Clarity SDK will not operate if you're running through Expo GO. To run the SDK locally, you can use the EAS Build system.
  • Currently, React Native package only supports Android.

ReactNative plugin allows integrating Clarity with your application.

Installation

Step 1

Run this command to add the package.

npm install react-native-clarity

Step 2

Add this code to start Clarity.

import { initialize } from 'react-native-clarity';

initialize("<ProjectId>");

Refer to the available APIs and how to use them here.

Step 3

After integrating Clarity with your application, if you'd like to test it on a device or an emulator, please make sure of the following:

  1. Your device/emulator is connected to the internet.
  2. Your device/emulator Android version is within the supported range 29-34 inclusive.
  3. On your first run, you might need to set the log level to Verbose to get the Clarity logs. These logs might be helpful in figuring out the initialization errors if any.

Then give it around 2 hours for the data to show up in your Clarity project on the Clarity website.

FAQ

For more answers, refer to FAQ.

Visit Clarity

:::column-end:::