Skip to content

Commit ddfd251

Browse files
authored
feat: add SENTRY_RELEASE and SENTRY_ENVIRONMENT (#1908)
1 parent 2ec2955 commit ddfd251

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- [utils] fix: Preserve function prototype when filling
6+
- [node] feat: Read from `SENTRY_RELEASE` and `SENTRY_ENVIRONMENT` if present
7+
58
## 4.6.1
69

710
- [utils] fix: Patch `tslib_1__default` regression and add additional tests around it

packages/node/src/sdk.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ export function init(options: NodeOptions = {}): void {
7474
options.dsn = process.env.SENTRY_DSN;
7575
}
7676

77+
if (options.release === undefined && process.env.SENTRY_RELEASE) {
78+
options.release = process.env.SENTRY_RELEASE;
79+
}
80+
81+
if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {
82+
options.environment = process.env.SENTRY_ENVIRONMENT;
83+
}
84+
7785
if (domain.active) {
7886
setHubOnCarrier(getMainCarrier(), getCurrentHub());
7987
}

0 commit comments

Comments
 (0)