Skip to content

Commit 47558e0

Browse files
committed
fixup! feat(node, bun, deno, cloudflare): Align portable exports across server SDKs
1 parent f57f1ee commit 47558e0

5 files changed

Lines changed: 25 additions & 14 deletions

File tree

‎dev-packages/cloudflare-integration-tests/suites/public-api/parameterize/index.ts‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff 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>;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineCloudflareOptions } from '@sentry/cloudflare';
2+
3+
export default defineCloudflareOptions((env: { SENTRY_DSN: string }) => ({
4+
dsn: env.SENTRY_DSN,
5+
}));
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
});
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
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
}

‎packages/node/src/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export {
2525
langGraphIntegration,
2626
lruMemoizerIntegration,
2727
createFlueInstrumentation,
28-
type FlueOptions,
2928
mastraIntegration,
3029
piDurableIntegration,
3130
mcpServerIntegration,

0 commit comments

Comments
 (0)