Skip to content

Dynamic environments & native init (sentry.options.json) #5779

@victorhenrion

Description

@victorhenrion

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

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions