React Native Integration Error

Imported react-native-sentry@0.29.0, linked it react-native link, and completed the setup. However, we’re now receiving an error asking for a secret key. Don’t know where that goes, or what secret key they’re referring to.

Invalid DSN, the following properties aren't set '[secret key]'

Here is the full stacktrace:

10-26 16:56:19.786 9922-9944/com.modenero.xxxxxxxx E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
     Process: com.modenero.xxxxxxxx, PID: 9922
     io.sentry.dsn.InvalidDsnException: Invalid DSN, the following properties aren't set '[secret key]'
         at io.sentry.dsn.Dsn.validate(
         at io.sentry.dsn.Dsn.<init>(
         at io.sentry.dsn.Dsn.<init>(
         at io.sentry.SentryClientFactory.resolveDsn(
         at io.sentry.SentryClientFactory.sentryClient(
         at io.sentry.Sentry.init(
         at io.sentry.RNSentryModule.startWithDsnString(
         at java.lang.reflect.Method.invoke(Native Method)
         at com.facebook.react.bridge.JavaMethodWrapper.invoke(
         at com.facebook.react.bridge.JavaModuleWrapper.invoke(
         at Method)
         at android.os.Handler.handleCallback(
         at android.os.Handler.dispatchMessage(
         at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(
         at android.os.Looper.loop(
         at com.facebook.react.bridge.queue.MessageQueueThreadImpl$

Hey, you need to use your DSN including the secret. You can find it in the project settings page where you copied the public DSN.

Why is the secret needed? Isn’t that a security risk?

The only difference between the public and non-public DSN is that the one without the secret was intended for websites and does some same origin checking to prevent abuse.

Since you’re running on a users device, there is no such thing as same origin checking so you have to use the “non-public” one.

If somebody gets your non-public DSN (the one with the secret) the worst they can do is post fake errors to you.