You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support SENTRY_HOST as alias for SENTRY_URL (#409)
## Summary
Adds `SENTRY_HOST` as a supported env var for configuring the Sentry
instance URL. It takes precedence over `SENTRY_URL` so both work, but
users who expect `SENTRY_HOST` (common in other Sentry tooling) get the
behavior they want out of the box.
Precedence: `SENTRY_HOST` > `SENTRY_URL` > default (`https://sentry.io`)
## Changes
A single `getConfiguredSentryUrl()` helper in `constants.ts` replaces
all 8 `process.env.SENTRY_URL` reads across 6 source files.
`applySentryUrlContext()` now sets/deletes both env vars so
`SENTRY_HOST` can't shadow a freshly-set `SENTRY_URL`.
## Test plan
- New tests for `SENTRY_HOST` alone and precedence over `SENTRY_URL` in
region, code-scanner, URL parser, and URL builder tests
- All 146 tests across the 4 modified test files pass
- `bun run typecheck` and `bun run lint` clean
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/src/content/docs/configuration.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,22 @@ The Sentry CLI can be configured through environment variables and a local datab
7
7
8
8
## Environment Variables
9
9
10
-
### `SENTRY_URL`
10
+
### `SENTRY_HOST`
11
11
12
12
Base URL of your Sentry instance. **Only needed for [self-hosted Sentry](./self-hosted/).** SaaS users (sentry.io) should not set this.
13
13
14
14
```bash
15
-
exportSENTRY_URL=https://sentry.example.com
15
+
exportSENTRY_HOST=https://sentry.example.com
16
16
```
17
17
18
18
When set, all API requests (including OAuth login) are directed to this URL instead of `https://sentry.io`. The CLI also sets this automatically when you pass a self-hosted Sentry URL as a command argument.
19
19
20
+
`SENTRY_HOST` takes precedence over `SENTRY_URL`. Both work identically — use whichever you prefer.
21
+
22
+
### `SENTRY_URL`
23
+
24
+
Alias for `SENTRY_HOST`. If both are set, `SENTRY_HOST` takes precedence.
0 commit comments