react-nativesentry

Protecting Senty Auth Token from being exposed in app bundle


I am building a react native app using Jenkins. My Sentry Auth Token is stored in a .env file. When I build the iOS or android app this Sentry Auth Token is exposed in the bundle. I would like to prevent this from being exposed to app bundle. I only need this in build time to upload the symbol maps. This should not be available in runtime or in the built app. Any help or guidance is appreciated.


Solution

  • You could use a file with the secret token, placed in secure directory, and ensure a script is run as part of the bundle process.

    An example to set env variables