Skip to content

feat(cloudflare): Export init from the SDK#21678

Closed
buttilda wants to merge 1 commit into
getsentry:developfrom
buttilda:feat/cloudflare-export-init
Closed

feat(cloudflare): Export init from the SDK#21678
buttilda wants to merge 1 commit into
getsentry:developfrom
buttilda:feat/cloudflare-export-init

Conversation

@buttilda

@buttilda buttilda commented Jun 22, 2026

Copy link
Copy Markdown

Summary

init is defined in packages/cloudflare/src/sdk.ts but is not re-exported from the package entry point (packages/cloudflare/src/index.ts), unlike every other Sentry SDK package. As a result, import { init } from '@sentry/cloudflare' / Sentry.init() is unavailable to consumers even though the implementation exists.

This re-exports init alongside the already-exported getDefaultIntegrations from ./sdk.

We've been carrying this as a local patch and would prefer to have it upstream.

`init` is defined in `packages/cloudflare/src/sdk.ts` but was not
re-exported from the package entry point, unlike every other Sentry SDK
package. Re-export it so consumers can call `Sentry.init()` from
`@sentry/cloudflare` directly.
@buttilda buttilda requested a review from a team as a code owner June 22, 2026 08:43
@buttilda buttilda requested review from andreiborza and mydea and removed request for a team June 22, 2026 08:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7b63a1b. Configure here.


export { CloudflareClient } from './client';
export { getDefaultIntegrations } from './sdk';
export { getDefaultIntegrations, init } from './sdk';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test for init export

Low Severity

This feat PR adds a public init export but the diff includes no unit, integration, or E2E test asserting that init is available from @sentry/cloudflare (for example via a named import from the package entry). Per Sentry JS SDK review guidelines, feature changes should include coverage that would fail if the export were removed again.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 7b63a1b. Configure here.

@andreiborza andreiborza requested a review from JPeer264 June 22, 2026 08:50
@JPeer264

Copy link
Copy Markdown
Member

We can't allow this atm, as we are setting up a new client on every request via Sentry.init. This would only be useful if there would be a reuse of a global client per call, which we don't have.

If there is any issue you are facing please open up an issue with more details of the exact problem you have.

@JPeer264 JPeer264 closed this Jun 22, 2026
@buttilda buttilda deleted the feat/cloudflare-export-init branch June 22, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants