sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

feat(expo): Add RNSentrySDK APIs support to @sentry/react-native/expo plugin

Open antonis opened this issue 10 months ago • 11 comments

:loudspeaker: Type of change

  • [ ] Bugfix
  • [x] New feature
  • [ ] Enhancement
  • [ ] Refactoring

Based on feat: Capture app start errors before JS

:scroll: Description

Adds RNSentrySDK APIs support to @sentry/react-native/expo plugin by importing sentry and adding injecting RNSentrySDK.init/start in the Android MainApplication (Kotlin or Java) or AppDelegate (Objective-C or Swift).

This feature is opt-out to enable it set useNativeInit to true in your @sentry/react-native/expo plugin configuration.

"plugins": [
  [
    "@sentry/react-native/expo",
    {
      "useNativeInit": true
    }
  ],

:bulb: Motivation and Context

Fixes https://github.com/getsentry/sentry-react-native/issues/4625

:green_heart: How did you test it?

CI, Manual

:pencil: Checklist

  • [x] I added tests to verify changes
  • [x] No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • [x] I updated the docs if needed.
  • [x] I updated the wizard if needed.
  • [x] All tests passing
  • [x] No breaking changes

:crystal_ball: Next steps

antonis avatar Mar 07 '25 11:03 antonis

Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 3885d704ccd9c6382b7ff19e4f07a778769ed8c1

github-actions[bot] avatar Mar 07 '25 11:03 github-actions[bot]

iOS (legacy) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1209.39 ms 1214.90 ms 5.51 ms
Size 2.63 MiB 3.78 MiB 1.15 MiB

github-actions[bot] avatar Mar 07 '25 11:03 github-actions[bot]

iOS (new) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1234.24 ms 1237.90 ms 3.65 ms
Size 3.19 MiB 4.35 MiB 1.17 MiB

github-actions[bot] avatar Mar 07 '25 12:03 github-actions[bot]

Android (legacy) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 441.12 ms 451.55 ms 10.43 ms
Size 17.75 MiB 20.15 MiB 2.40 MiB

github-actions[bot] avatar Mar 07 '25 14:03 github-actions[bot]

Android (new) Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 351.04 ms 404.94 ms 53.90 ms
Size 7.15 MiB 8.42 MiB 1.27 MiB

github-actions[bot] avatar Mar 07 '25 14:03 github-actions[bot]

Note: The Build & Test / Type Check Typescript 3.8 (pull_request) failure should be fixed when we merge https://github.com/getsentry/sentry-react-native/pull/4673 from main

antonis avatar Apr 04 '25 10:04 antonis

I'm currently updating the base branch with the latest main since there was quite a lot of development that was not synced to the feature branch.

krystofwoldrich avatar Jun 11 '25 08:06 krystofwoldrich

I'm currently updating the base branch with the latest main since there was quite a lot of development that was not synced to the feature branch.

Thank you for the heads up @krystofwoldrich 🙇 I'll update this branch after that along with the review feedback.

antonis avatar Jun 11 '25 08:06 antonis

@sentry review

lucas-zimerman avatar Oct 15 '25 16:10 lucas-zimerman