Repository navigation
ref(api): Read the API base path from @sentry/api - #2233
Merged
Merged
Conversation
@sentry/api 2.0 reads the API base path (/api/0) from the server URL in Sentry's OpenAPI spec, exports it as API_BASE_PATH, and makes operation paths and raw request URLs relative to it. Use the export instead of private /api/0 copies, pass relative URLs to prepareRequest, and keep the CLI's endpoint index in full request paths by prefixing the base path. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
2.0.0 exports API_BASE_PATH and reads the base path from the spec's server URL, which this branch depends on.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Nov 13, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on:
@sentry/api2.0.0, which is published (getsentry/sentry-api-schema#148). This is the last step of the chain sentry-api-schema#148 → sentry-docs#20787 → sentry#131065 → this PR.Sentry's OpenAPI spec is moving
/api/0out of every path and into its server URL.@sentry/api2.0 reads the base path from that URL, exports it asAPI_BASE_PATH, and makes operation paths relative. This PR drops toolkit's private/api/0copies and uses the export instead, so the version number lives only in the spec.Before:
After:
sentry schemaandsentry apistill show and accept/api/0/....prepareRequest./api/0.@sentry/api1.x → 2.0.0 bump. CLI and MCP behavior doesn't change, so no toolkit major is needed.#2229 (stacked on #1807): on 2.0 it needs two changes:
API_PREFIX = "/api/0"inerror-reporting.tswithAPI_BASE_PATH;api-path-templates.jsonfrom`${API_BASE_PATH}${op.path}`, becauseop.pathis now relative.Checks:
pnpm run tscandpnpm run lintpass.pnpm install --frozen-lockfilepasses with theminimumReleaseAgeExcludeentry moved from 1.83.0 to 2.0.0.--
View Session [Sentry]