File tree Expand file tree Collapse file tree
dev-packages/cloudflare-integration-tests/suites/public-api/parameterize Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,15 +4,12 @@ interface Env {
44 SENTRY_DSN : string ;
55}
66
7- export default Sentry . withSentry (
8- ( env : Env ) => ( {
9- dsn : env . SENTRY_DSN ,
10- } ) ,
11- {
12- async fetch ( _request , _env , _ctx ) {
13- const userId = 42 ;
14- Sentry . captureMessage ( Sentry . parameterize `User ${ userId } logged in` ) ;
15- return new Response ( 'ok' ) ;
16- } ,
7+ // A plain worker. The `@sentry/cloudflare/vite` plugin wraps it with `withSentry` at build time,
8+ // with the options from `instrument.server.ts`.
9+ export default {
10+ async fetch ( ) : Promise < Response > {
11+ const userId = 42 ;
12+ Sentry . captureMessage ( Sentry . parameterize `User ${ userId } logged in` ) ;
13+ return new Response ( 'ok' ) ;
1714 } ,
18- ) ;
15+ } satisfies ExportedHandler < Env > ;
Original file line number Diff line number Diff line change 1+ import { defineCloudflareOptions } from '@sentry/cloudflare' ;
2+
3+ export default defineCloudflareOptions ( ( env : { SENTRY_DSN : string } ) => ( {
4+ dsn : env . SENTRY_DSN ,
5+ } ) ) ;
Original file line number Diff line number Diff line change 1+ import { cloudflare } from '@cloudflare/vite-plugin' ;
2+ import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite' ;
3+ import { defineConfig } from 'vite' ;
4+
5+ export default defineConfig ( {
6+ plugins : [ cloudflare ( ) , sentryCloudflareVitePlugin ( ) ] ,
7+ } ) ;
Original file line number Diff line number Diff line change 11{
2- "name" : " worker-name" ,
3- "compatibility_date" : " 2025-06-17" ,
2+ "$schema" : " ../../../node_modules/wrangler/config-schema.json" ,
3+ "name" : " cloudflare-public-api-parameterize" ,
4+ // `main` points at the source entry. The Sentry Vite plugin builds from it, and the runner serves
5+ // the built output.
46 "main" : " index.ts" ,
7+ "compatibility_date" : " 2025-06-17" ,
58 "compatibility_flags" : [" nodejs_compat" ],
69}
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export {
2525 langGraphIntegration ,
2626 lruMemoizerIntegration ,
2727 createFlueInstrumentation ,
28- type FlueOptions ,
2928 mastraIntegration ,
3029 piDurableIntegration ,
3130 mcpServerIntegration ,
You can’t perform that action at this time.
0 commit comments