Repository navigation
Conversation
…createSentryClient)
Configure the client once instead of threading baseUrl + auth into every call.
`bearerToken({ token })` returns a typed config (default baseUrl https://sentry.io) for
`client.setConfig(...)` (global) or `createSentryClient(...)` (isolated, for servers/tests).
`browserSession()` (in ./browser) is the blessed name for the existing cookie+CSRF browser
config; `createBrowserSdkConfig` stays as an alias.
Re-exports the client (`client`, `createClient`, `createSentryClient`, `createConfig`, `Config`)
from the public entry so consumers configure it without reaching into generated internals.
Pure builders, no side effects, no `mode` enum. Additive and opt-in; existing per-call config
still works. First of three PRs (auth factories -> region routing -> query accuracy) toward one
SDK for the CLI, MCP, and frontend.
Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Jul 10, 2026
Update the auth-factory branch with current main, document deployment and region ownership, and validate public client composition across Bun and Node.
betegon
marked this pull request as ready for review
September 25, 2026 12:59
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.
Configuring a Sentry deployment and credentials currently requires repeating options across calls. Export the generated client and add
bearerToken(...)andbrowserSession(...)so consumers can configure requests once. Servers can create an isolatedcreateSentryClient(...)per deployment and authentication context.Before and after
Here,
tokenandbaseUrlcome from the consumer's deployment configuration.Before: pass deployment and authentication options to each operation.
After: configure an isolated client once and reuse it across operations.
Each instance belongs to one deployment and authentication context. For a single-context application, the exported singleton also supports
client.setConfig(bearerToken({ token, baseUrl })), followed by calls without aclientoption. Result and error handling are unchanged.Explicit Enterprise, self-hosted, custom, and regional origins are preserved without discovery or extra requests. Existing custom fetch implementations and per-call overrides still compose with the client. The browser factory reuses the existing cookie/CSRF helper. Generated fetch configuration accepts portable callable implementations under both Bun and Node, without requiring runtime-specific properties such as
fetch.preconnect.The README covers the public entry points, and the client design records region/cache ownership, control versus regional operations, canonical web links, and consumer responsibilities. This foundation can support a bounded MCP adoption with raw adapters for endpoints outside the public schema; it does not need to wait for the routing and progressive-accuracy helpers in #79 and #80. Region discovery/cache, link builders, retries, and identity endpoint publication remain separate work.
Validation:
bun run build,bun run typecheck(Bun/DOM and Node-only declarations),bun test(115 passing), andnpm pack. Public-package contract tests cover exact request origins, credential isolation, overrides, custom transport, error policy, generic requests, and browser authentication. A Node smoke test against the unpacked tarball verified imports and singleton request configuration without validator dependencies. No live Sentry deployment or real browser was exercised.Part of #81.