feat(cloudflare): Export init from the SDK#21678
Conversation
`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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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'; |
There was a problem hiding this comment.
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.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 7b63a1b. Configure here.
|
We can't allow this atm, as we are setting up a new client on every request via If there is any issue you are facing please open up an issue with more details of the exact problem you have. |


Summary
initis defined inpackages/cloudflare/src/sdk.tsbut 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
initalongside the already-exportedgetDefaultIntegrationsfrom./sdk.We've been carrying this as a local patch and would prefer to have it upstream.