From d252a7f46b04d4f07ddc56dd5e5f9856dd600d88 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 4 May 2026 17:09:43 +0200 Subject: [PATCH 1/4] docs(react-native): Add default context documentation Document the context data automatically collected by the React Native SDK, including React Native runtime info, native device/system context, JavaScript modules, and Expo-specific context fields. Refs getsentry/sentry-react-native#3014 Co-Authored-By: Claude --- .../context/default-context.mdx | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docs/platforms/react-native/enriching-events/context/default-context.mdx diff --git a/docs/platforms/react-native/enriching-events/context/default-context.mdx b/docs/platforms/react-native/enriching-events/context/default-context.mdx new file mode 100644 index 0000000000000..98fabcb697632 --- /dev/null +++ b/docs/platforms/react-native/enriching-events/context/default-context.mdx @@ -0,0 +1,81 @@ +--- +title: Default Context +sidebar_order: 500 +description: "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. + +## React Native Context + +The SDK collects runtime information specific to React Native and stores it in the `react_native_context` context: + +- `turbo_module` — whether TurboModule is enabled +- `fabric` — whether Fabric (new renderer) is enabled +- `react_native_version` — React Native version +- `expo` — whether the app is running on Expo +- `js_engine` — JavaScript engine name (for example, `hermes`) +- `hermes_version` — Hermes version (if Hermes is enabled) +- `hermes_debug_info` — whether the Hermes bundle includes debug info +- `component_stack` — React component stack (when available on errors) +- `expo_go_version` — Expo Go version (if running in Expo Go) +- `expo_sdk_version` — Expo SDK version (if running on Expo) + +## SDK Info + +- `name` — SDK name (for example, `sentry.javascript.react-native`) +- `version` — SDK version +- `packages` — native SDK dependencies and their versions (for example, `sentry-cocoa` and `sentry-android`) + +## Native Device and System Context + +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](/platforms/android/enriching-events/context/default-context/) for the full list of fields, including device info, screen, memory, storage, battery, locale, and more. +- **iOS**: The Sentry Cocoa SDK provides device, OS, app state, memory, and battery information natively. See [Apple Context](/platforms/apple/enriching-events/context/) for more details. + +In addition, the React Native SDK sets `in_foreground` in the app context to indicate whether the app is in the foreground at the time of the event. + +## Modules + +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. + +## Expo-Specific Context + +If your app runs on Expo, the SDK collects additional context. + +### OTA Updates + +Stored in the `ota_updates` context: + +- `is_enabled` — whether OTA updates are enabled +- `is_embedded_launch` — whether this is an embedded launch +- `is_emergency_launch` — whether this is an emergency launch +- `emergency_launch_reason` — reason for emergency launch +- `is_using_embedded_assets` — whether using embedded assets +- `update_id` — current update ID +- `channel` — EAS Update channel +- `runtime_version` — runtime version +- `check_automatically` — automatic update check setting +- `launch_duration` — launch duration in milliseconds +- `created_at` — update creation timestamp + +### Expo Constants + +Stored in the `expo_constants` context: + +- `execution_environment` — where the app is running +- `app_ownership` — app ownership type +- `debug_mode` — whether the app is in debug mode +- `expo_version` — Expo version +- `expo_runtime_version` — Expo runtime version +- `session_id` — unique session ID +- `status_bar_height` — status bar height in pixels +- `app_name` — app name from Expo config +- `app_slug` — app slug from Expo config +- `app_version` — app version from Expo config +- `expo_sdk_version` — Expo SDK version from Expo config +- `eas_project_id` — EAS project ID + From df8b24ed84d0c77e47b6a1751abf54dcc64ed180 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 7 May 2026 14:00:44 +0200 Subject: [PATCH 2/4] Alphabetize lists --- .../context/default-context.mdx | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/platforms/react-native/enriching-events/context/default-context.mdx b/docs/platforms/react-native/enriching-events/context/default-context.mdx index 98fabcb697632..c1d3e5bc853f2 100644 --- a/docs/platforms/react-native/enriching-events/context/default-context.mdx +++ b/docs/platforms/react-native/enriching-events/context/default-context.mdx @@ -12,22 +12,22 @@ Default context helps correlate errors with factors such as specific device type The SDK collects runtime information specific to React Native and stores it in the `react_native_context` context: -- `turbo_module` — whether TurboModule is enabled -- `fabric` — whether Fabric (new renderer) is enabled -- `react_native_version` — React Native version -- `expo` — whether the app is running on Expo -- `js_engine` — JavaScript engine name (for example, `hermes`) -- `hermes_version` — Hermes version (if Hermes is enabled) -- `hermes_debug_info` — whether the Hermes bundle includes debug info - `component_stack` — React component stack (when available on errors) +- `expo` — whether the app is running on Expo - `expo_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 enabled +- `hermes_debug_info` — whether the Hermes bundle includes debug info +- `hermes_version` — Hermes version (if Hermes is enabled) +- `js_engine` — JavaScript engine name (for example, `hermes`) +- `react_native_version` — React Native version +- `turbo_module` — whether TurboModule is enabled ## SDK Info - `name` — SDK name (for example, `sentry.javascript.react-native`) -- `version` — SDK version - `packages` — native SDK dependencies and their versions (for example, `sentry-cocoa` and `sentry-android`) +- `version` — SDK version ## Native Device and System Context @@ -50,32 +50,32 @@ If your app runs on Expo, the SDK collects additional context. Stored in the `ota_updates` context: -- `is_enabled` — whether OTA updates are enabled +- `channel` — EAS Update channel +- `check_automatically` — automatic update check setting +- `created_at` — update creation timestamp - `is_embedded_launch` — whether this is an embedded launch - `is_emergency_launch` — whether this is an emergency launch -- `emergency_launch_reason` — reason for emergency launch +- `is_enabled` — whether OTA updates are enabled - `is_using_embedded_assets` — whether using embedded assets -- `update_id` — current update ID -- `channel` — EAS Update channel -- `runtime_version` — runtime version -- `check_automatically` — automatic update check setting +- `emergency_launch_reason` — reason for emergency launch - `launch_duration` — launch duration in milliseconds -- `created_at` — update creation timestamp +- `runtime_version` — runtime version +- `update_id` — current update ID ### Expo Constants Stored in the `expo_constants` context: -- `execution_environment` — where the app is running +- `app_name` — app name from Expo config - `app_ownership` — app ownership type +- `app_slug` — app slug from Expo config +- `app_version` — app version from Expo config - `debug_mode` — whether the app is in debug mode -- `expo_version` — Expo version +- `eas_project_id` — EAS project ID +- `execution_environment` — where the app is running - `expo_runtime_version` — Expo runtime version +- `expo_sdk_version` — Expo SDK version from Expo config +- `expo_version` — Expo version - `session_id` — unique session ID - `status_bar_height` — status bar height in pixels -- `app_name` — app name from Expo config -- `app_slug` — app slug from Expo config -- `app_version` — app version from Expo config -- `expo_sdk_version` — Expo SDK version from Expo config -- `eas_project_id` — EAS project ID From aa919bca610982febaa21fc0cfceacfb2e34de16 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 7 May 2026 14:02:56 +0200 Subject: [PATCH 3/4] Jut point to Apple docs instead of listing --- .../react-native/enriching-events/context/default-context.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/react-native/enriching-events/context/default-context.mdx b/docs/platforms/react-native/enriching-events/context/default-context.mdx index c1d3e5bc853f2..4ec29d599e7bc 100644 --- a/docs/platforms/react-native/enriching-events/context/default-context.mdx +++ b/docs/platforms/react-native/enriching-events/context/default-context.mdx @@ -34,7 +34,7 @@ The SDK collects runtime information specific to React Native and stores it in t 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](/platforms/android/enriching-events/context/default-context/) for the full list of fields, including device info, screen, memory, storage, battery, locale, and more. -- **iOS**: The Sentry Cocoa SDK provides device, OS, app state, memory, and battery information natively. See [Apple Context](/platforms/apple/enriching-events/context/) for more details. +- **iOS**: See [Apple Context](/platforms/apple/enriching-events/context/) for the full list of fields. In addition, the React Native SDK sets `in_foreground` in the app context to indicate whether the app is in the foreground at the time of the event. From ffa25afc266aac05360ecc1815700cc352a65154 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 7 May 2026 14:07:10 +0200 Subject: [PATCH 4/4] Moves in_foreground from the Native Device section --- .../react-native/enriching-events/context/default-context.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/react-native/enriching-events/context/default-context.mdx b/docs/platforms/react-native/enriching-events/context/default-context.mdx index 4ec29d599e7bc..e42ea2853ccb4 100644 --- a/docs/platforms/react-native/enriching-events/context/default-context.mdx +++ b/docs/platforms/react-native/enriching-events/context/default-context.mdx @@ -23,6 +23,8 @@ The SDK collects runtime information specific to React Native and stores it in t - `react_native_version` — React Native version - `turbo_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. + ## SDK Info - `name` — SDK name (for example, `sentry.javascript.react-native`) @@ -36,8 +38,6 @@ The SDK collects device, operating system, app, screen, memory, storage, and bat - **Android**: See [Android Default Context](/platforms/android/enriching-events/context/default-context/) for the full list of fields, including device info, screen, memory, storage, battery, locale, and more. - **iOS**: See [Apple Context](/platforms/apple/enriching-events/context/) for the full list of fields. -In addition, the React Native SDK sets `in_foreground` in the app context to indicate whether the app is in the foreground at the time of the event. - ## Modules 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.