Skip to content

Conversation

@WalshyDev
Copy link
Contributor

Adds a new transport option to the Cloudflare provider, this allows specifying a custom fetch implementation. This allows for Workers VPC to send into an internal Sentry.

Example usage:

export default Sentry.withSentry(
  (env: Env) => ({
    dsn: env.SENTRY_DSN,
    release: env.VERSION_METADATA.tag ?? env.VERSION_METADATA.id,
    transportOptions: {
      fetch: env.SENTRY_VPC_BRIDGE.fetch.bind(env.SENTRY_VPC_BRIDGE),
    },
  }),
  {
    async fetch(req, env) {
      return new Response("ok");
    },
};

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@WalshyDev WalshyDev force-pushed the walshy/add-custom-fetch-cf-transport branch from f6ab666 to 05a871a Compare November 26, 2025 09:43
@WalshyDev WalshyDev changed the title Allow specifying a custom fetch in Cloudflare transport options feat(cloudflare): Allow specifying a custom fetch in Cloudflare transport options Nov 26, 2025
@WalshyDev WalshyDev force-pushed the walshy/add-custom-fetch-cf-transport branch from 05a871a to b55e9e1 Compare November 28, 2025 02:55
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Hey, thanks for opening this PR! This makes sense to me on first glance but I'll let @JPeer264 and @AbhiPrasad have the final say.

@Lms24 Lms24 requested review from AbhiPrasad and JPeer264 November 28, 2025 11:14
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Thanks!

@AbhiPrasad AbhiPrasad merged commit 5c51fdb into getsentry:develop Nov 28, 2025
47 checks passed
@WalshyDev WalshyDev deleted the walshy/add-custom-fetch-cf-transport branch November 28, 2025 23:12
@WalshyDev
Copy link
Contributor Author

Thank you!

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.

3 participants