Skip to content

Sentry.addIntegration() is not a function #5017

@gmaclennan

Description

@gmaclennan

What React Native libraries do you use?

React Navigation

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.18.1

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇ 

info Fetching system and libraries information...
System:
  OS: macOS 15.5
  CPU: (12) arm64 Apple M2 Pro
  Memory: 215.64 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: ~/.local/state/fnm_multishells/49031_1753361374989/bin/node
  Yarn: Not Found
  npm:
    version: 10.8.2
    path: ~/.local/state/fnm_multishells/49031_1753361374989/bin/npm
  Watchman:
    version: 2025.06.30.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK:
    API Levels:
      - "23"
      - "28"
      - "29"
      - "30"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
    System Images:
      - android-29 | ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.25659.59.2432.13423653
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.9
    wanted: 0.76.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.80.1 is now available (your project is running on v0.76.9).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.80.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.9&to=0.80.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".



Sentry.init()

Sentry.init({
  dsn: 'https://...@sentry.io/...'
  tracesSampleRate: appMetricsOptIn ? 1.0 : 0,
  enableUserInteractionTracing: appMetricsOptIn, 
  environment: sentryEnvironment,
  debug: sentryDebug,
  initialScope: {user: {id: sentryUserId}},
});

Steps to Reproduce

Call Sentry.addIntegration() after init.

Expected Result

According to the docs, "you can add integrations via Sentry.addIntegration()"

Actual Result

The function does not exist, but you can call Sentry.getClient()?.addIntegration()

Either the docs need updated, or the method needs to be added.

Metadata

Metadata

Assignees

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions