Skip to main content
Skip to main content

React Native

The ClickStack React Native SDK allows you to instrument your React Native application to send events to ClickStack. This allows you to see mobile network requests and exceptions alongside backend events in a single timeline.

This Guide Integrates:

  • XHR/Fetch Requests

Getting started

Install via NPM

Use the following command to install the ClickStack React Native package.

Initialize ClickStack

Initialize the library as early in your app lifecycle as possible:

Attach user information or metadata (Optional)

Attaching user information will allow you to search/filter sessions and events in HyperDX. This can be called at any point during the client session. The current client session and all events sent after the call will be associated with the user information.

userEmail, userName, and teamName will populate the sessions UI with the corresponding values, but can be omitted. Any other additional values can be specified and used to search for events.

Instrument lower versions

To instrument applications running on React Native versions lower than 0.68, edit your metro.config.js file to force metro to use browser specific packages. For example:

View navigation

react-navigation version 5 and 6 are supported.

The following example shows how to instrument navigation: