-
-
Notifications
You must be signed in to change notification settings - Fork 359
Description
Description
The Expo setup documentation states that when useNativeInit is set to true, the Expo plugin automatically:
When
useNativeInitis set totrue, the Expo plugin automatically:
Createssentry.options.jsonfrom your Expo config
AddsRNSentrySDK.init()to your AndroidMainApplication
AddsRNSentrySDK.start()to your iOSAppDelegate
In practice, the plugin does add the native init calls and writes sentry.properties (for build-time: org, project, url, auth), but it does not create sentry.options.json, which is what the native SDK reads at runtime for DSN and other options.
Questions
-
Do we need to create
sentry.options.jsonourselves when usinguseNativeInit: truewith the Expo plugin, with the required fields (e.g. DSN and any other runtime options)? If yes, could this be clarified in the docs and/or could the Expo plugin accept these options and generatesentry.options.jsonfrom them (e.g. pass dsn and any other needed options in the plugin config so we don’t have to maintain a separate file)? -
Plugin form vs
withSentry()
The docs show the plugin in array form: https://docs.sentry.io/platforms/react-native/manual-setup/app-start-error-capture/:
[
"@sentry/react-native/expo",
{
"useNativeInit": true
}
]
but Expo setup doc https://docs.sentry.io/platforms/react-native/manual-setup/expo/:
import { withSentry } from "@sentry/react-native/expo";
export default withSentry(config, {
url: "https://sentry.io/",
project: "X",
organization: "X",
useNativeInit: true,
});
Are these two approaches equivalent (same plugin, same behavior), or is there a functional difference between registering the plugin via the plugins array vs wrapping the config with withSentry()?
Metadata
Metadata
Assignees
Projects
Status