Default Context
The React Native SDK automatically enriches context with additional information about the device, system, runtime, and release version of your application.
The React Native SDK automatically enriches context with additional information about the device, system, runtime, and release version of your application.
Default context helps correlate errors with factors such as specific device types, OS versions, and React Native runtime details so that you can find the root cause of the problem faster.
The SDK collects runtime information specific to React Native and stores it in the react_native_context context:
component_stack— React component stack (when available on errors)expo— whether the app is running on Expoexpo_go_version— Expo Go version (if running in Expo Go)expo_sdk_version— Expo SDK version (if running on Expo)fabric— whether Fabric (new renderer) is enabledhermes_debug_info— whether the Hermes bundle includes debug infohermes_version— Hermes version (if Hermes is enabled)js_engine— JavaScript engine name (for example,hermes)react_native_version— React Native versionturbo_module— whether TurboModule is enabled
The SDK also sets in_foreground in the app context to indicate whether the app is in the foreground at the time of the event.
name— SDK name (for example,sentry.javascript.react-native)packages— native SDK dependencies and their versions (for example,sentry-cocoaandsentry-android)version— SDK version
The SDK collects device, operating system, app, screen, memory, storage, and battery information from the underlying native SDKs. The available fields depend on the platform:
- Android: See Android Default Context for the full list of fields, including device info, screen, memory, storage, battery, locale, and more.
- iOS: See Apple Context for the full list of fields.
The SDK collects a list of JavaScript packages and their versions used by your application. During the build process, the SDK analyzes the bundle source map to extract package names and versions into a modules.json file. At runtime, this data is loaded and attached to each event as event.modules, helping you identify which dependency versions are running when an error occurs.
If your app runs on Expo, the SDK collects additional context.
Stored in the ota_updates context:
channel— EAS Update channelcheck_automatically— automatic update check settingcreated_at— update creation timestampis_embedded_launch— whether this is an embedded launchis_emergency_launch— whether this is an emergency launchis_enabled— whether OTA updates are enabledis_using_embedded_assets— whether using embedded assetsemergency_launch_reason— reason for emergency launchlaunch_duration— launch duration in millisecondsruntime_version— runtime versionupdate_id— current update ID
Stored in the expo_constants context:
app_name— app name from Expo configapp_ownership— app ownership typeapp_slug— app slug from Expo configapp_version— app version from Expo configdebug_mode— whether the app is in debug modeeas_project_id— EAS project IDexecution_environment— where the app is runningexpo_runtime_version— Expo runtime versionexpo_sdk_version— Expo SDK version from Expo configexpo_version— Expo versionsession_id— unique session IDstatus_bar_height— status bar height in pixels
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").