Closed TowhidKashem closed 1 year ago
Same issue on
Event though I ran expo r -c
, it's still showing the warning
It's telling you to omit the following from your app.json config, and instead just have it as an environment variable.
authToken: process.env.SENTRY_AUTH_TOKEN
This is to avoid that authToken (in your app.json) being leaked in application update manifests.
Read more here: https://docs.expo.dev/guides/using-sentry/#app-configuration
It's telling you to omit the following from your app.json config, and instead just have it as an environment variable.
authToken: process.env.SENTRY_AUTH_TOKEN
This is to avoid that authToken (in your app.json) being leaked in application update manifests.
Read more here: https://docs.expo.dev/guides/using-sentry/#app-configuration
Doh I misread the instructions, thanks! So now the hook in my app.config.js
looks like:
hooks: {
postPublish: [
{
file: 'sentry-expo/upload-sourcemaps',
config: {
organization: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT
}
}
]
},
and I uploaded the auth token in my Expo dashboard's secret section:
Am I good or Is there more I need to do?
@TowhidKashem that's what I did and it seems to be fine 👍
I can confirm these changes are enough to get rid of the original warning and still have Sentry work with source maps, closing.
To be honest, the warning message is very confusing. It needs to state that you don't need to setup the authToken in the app.json at all, instead, set SENTRY_AUTH_TOKEN as Expo Secret is sufficient enough.
Thanks - removing authToken: process.env.SENTRY_AUTH_TOKEN
from app.json and then adding the authToken to 'Project secrets' in the Expo dashboard - and then having the organization: process.env.SENTRY_ORG
& project: process.env.SENTRY_PROJECT
in the app.config.js (as above) was the way to go.
I lost ages on this, the warning/Docs are really really vague. Much appreciated!
It's telling you to omit the following from your app.json config, and instead just have it as an environment variable.
authToken: process.env.SENTRY_AUTH_TOKEN
This is to avoid that authToken (in your app.json) being leaked in application update manifests.
Read more here: https://docs.expo.dev/guides/using-sentry/#app-configuration
How to generate the eas build after using .env. I tried generating one but my apis werent working after using .env
Hi this solve the problem for eas online building. But if you build local, it will not work as the secret is only for eas online server building. There should be a solution for local building IMO Thanks
For local builds set the token manually
export SENTRY_AUTH_TOKEN=YOUR-TOKEN
then run the build command
Hi, I build android locally and ios online. Will try to test your solution. thanks!
Summary
I'm using env variables as recommended to store the sensitive sentry info in app.config.js:
But I'm still getting each time I start the app using
npx expo start --dev-client
:Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
48
Environment
Reproducible demo or steps to reproduce from a blank project
sentry-expo
"npx expo start --dev-client