Problem Statement
The recent useNativeInit config plugin option allows initializing Sentry on the native side via sentry.options.json before JS runs. However, there's currently no way to dynamically specify the environment field dynamically.
While calling Sentry.init() in JS allows overwriting the environment, but pre-JS crashes would still be tagged with an incorrect (hardcoded) environment.
Solution Brainstorm
- Get environment from
SENTRY_ENVIRONMENT env variable
- Get environment
environment config plugin option
- Dynamic config file like
sentry.options.js
Are you willing to submit a PR?
None
Problem Statement
The recent
useNativeInitconfig plugin option allows initializing Sentry on the native side viasentry.options.jsonbefore JS runs. However, there's currently no way to dynamically specify theenvironmentfield dynamically.While calling
Sentry.init()in JS allows overwriting the environment, but pre-JS crashes would still be tagged with an incorrect (hardcoded) environment.Solution Brainstorm
SENTRY_ENVIRONMENTenv variableenvironmentconfig plugin optionsentry.options.jsAre you willing to submit a PR?
None