From 73620310c72dc7378ced52f025d67e2fbaeb2d38 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Wed, 18 Nov 2026 12:13:23 +0100 Subject: [PATCH] docs(js): Add a vinext guide with a sentry init quick start Moves the vinext setup out of the Next.js on Cloudflare page into its own guide. The quick start uses `sentry init`, and Manual Setup > Cloudflare has the manual steps. The shared pages that Cloudflare supports also show for vinext, except Tunneling. The quick start sidebar title names the runtime whenever the guide page sets `runtime`, so the vinext quick start shows "Quick Start (Cloudflare)". Co-Authored-By: Claude Opus 5.5 --- .../javascript/common/agent-tracing/index.mdx | 6 +- .../javascript/common/configuration/apis.mdx | 4 +- .../common/configuration/integrations/anr.mdx | 1 + .../integrations/awslambdaweb.mdx | 1 + .../configuration/integrations/bullmq.mdx | 1 + .../integrations/childProcess.mdx | 1 + .../integrations/event-loop-block.mdx | 1 + .../integrations/fetchIntegration.mdx | 1 + .../configuration/integrations/firebase.mdx | 1 + .../common/configuration/integrations/fs.mdx | 1 + .../configuration/integrations/http.mdx | 1 + .../configuration/integrations/index.mdx | 2 +- .../integrations/localvariables.mdx | 1 + .../configuration/integrations/mistral.mdx | 2 +- .../integrations/nodecontext.mdx | 1 + .../configuration/integrations/nodefetch.mdx | 1 + .../integrations/nodeprofiling.mdx | 1 + .../integrations/noderuntimemetrics.mdx | 1 + .../configuration/integrations/postgresjs.mdx | 2 +- .../configuration/integrations/typesafe.mdx | 1 + .../common/configuration/options.mdx | 18 +-- .../common/configuration/tunneling.mdx | 2 + .../javascript/common/crons/index.mdx | 4 +- .../data-management/data-collected/index.mdx | 6 +- .../data-collected/index__v10.x.mdx | 8 +- .../common/enriching-events/index.mdx | 2 +- docs/platforms/javascript/common/index.mdx | 4 +- .../javascript/common/install/bundler.mdx | 1 + .../common/install/esm-without-import.mdx | 1 + .../javascript/common/install/index.mdx | 1 + .../common/install/late-initialization.mdx | 1 + .../single-executable-applications.mdx | 1 + .../javascript/common/logs/index.mdx | 12 +- .../common/mcp-monitoring/index.mdx | 2 +- .../common/migration/v10-to-v11/index.mdx | 14 +- .../common/migration/v4-to-v5_v6.mdx | 1 + .../javascript/common/migration/v6-to-v7.mdx | 1 + .../common/migration/v7-to-v8/index.mdx | 1 + .../migration/v7-to-v8/v7-deprecations.mdx | 1 + .../v7-to-v8/v8-new-performance-api.mdx | 1 + .../javascript/common/migration/v8-to-v9.mdx | 6 +- .../javascript/common/profiling/index.mdx | 1 + .../common/session-replay/index.mdx | 2 +- .../common/sourcemaps/uploading/wrangler.mdx | 1 + .../javascript/common/tracing/index.mdx | 2 +- .../common/troubleshooting/index.mdx | 2 +- .../javascript/guides/vinext/index.mdx | 72 +++++++++++ .../guides/vinext/manual-setup/cloudflare.mdx | 122 ++++++++++++++++++ .../guides/vinext/manual-setup/index.mdx | 11 ++ includes/quick-start-features-expandable.mdx | 2 +- .../quick-start-locate-data-expandable.mdx | 2 +- .../auto-session-tracking/javascript.mdx | 2 +- .../javascript.nextjs.mdx | 14 +- .../javascript.vinext.mdx | 19 +++ .../javascript.vinext.mdx | 25 ++++ .../how-it-works/javascript.vinext.mdx | 14 ++ .../javascript.vinext.mdx | 5 + .../frameworkSelector/frameworks.ts | 1 + src/components/runtimeLinks.spec.ts | 8 +- src/components/runtimeLinks.ts | 12 +- 60 files changed, 368 insertions(+), 68 deletions(-) create mode 100644 docs/platforms/javascript/guides/vinext/index.mdx create mode 100644 docs/platforms/javascript/guides/vinext/manual-setup/cloudflare.mdx create mode 100644 docs/platforms/javascript/guides/vinext/manual-setup/index.mdx create mode 100644 platform-includes/getting-started-data-collection/javascript.vinext.mdx create mode 100644 platform-includes/getting-started-verify/javascript.vinext.mdx create mode 100644 platform-includes/sentry-init/how-it-works/javascript.vinext.mdx create mode 100644 platform-includes/sentry-init/manual-setup-callout/javascript.vinext.mdx diff --git a/docs/platforms/javascript/common/agent-tracing/index.mdx b/docs/platforms/javascript/common/agent-tracing/index.mdx index 1768b8651e0dd..4c6c937ab22f7 100644 --- a/docs/platforms/javascript/common/agent-tracing/index.mdx +++ b/docs/platforms/javascript/common/agent-tracing/index.mdx @@ -108,7 +108,7 @@ As of SDK version `11.0.0`, Sentry auto-instruments the most popular AI SDKs and ]} /> - + ## Compose Cloudflare Instrumentation @@ -154,7 +154,7 @@ Any of `id`, `email`, or `username` is sufficient — the Conversations tab disp The SDK records generative AI inputs and outputs by default. To turn them off: - + ```javascript Sentry.init({ @@ -169,7 +169,7 @@ You can also set `recordInputs` / `recordOutputs` on a specific AI integration. - + ```typescript {filename:src/instrument.server.ts} import { defineCloudflareOptions } from "@sentry/cloudflare"; diff --git a/docs/platforms/javascript/common/configuration/apis.mdx b/docs/platforms/javascript/common/configuration/apis.mdx index 27cb1f9d4b750..06d9cd019b945 100644 --- a/docs/platforms/javascript/common/configuration/apis.mdx +++ b/docs/platforms/javascript/common/configuration/apis.mdx @@ -25,7 +25,7 @@ Sentry.setTag("tag", "value"); ## Core APIs - + - + `Sentry.setUser()` will set the user for the currently active request - see Request Isolation for more information. For example, if you want to set the user for a single request, you can do this like this: diff --git a/docs/platforms/javascript/common/configuration/integrations/anr.mdx b/docs/platforms/javascript/common/configuration/integrations/anr.mdx index 89b899437a434..4a64f3570b41e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/anr.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/anr.mdx @@ -10,6 +10,7 @@ notSupported: - javascript.elysia - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/awslambdaweb.mdx b/docs/platforms/javascript/common/configuration/integrations/awslambdaweb.mdx index feb43853bba98..d6d8f0d80a3e2 100644 --- a/docs/platforms/javascript/common/configuration/integrations/awslambdaweb.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/awslambdaweb.mdx @@ -10,6 +10,7 @@ notSupported: - javascript.bun - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/bullmq.mdx b/docs/platforms/javascript/common/configuration/integrations/bullmq.mdx index 1e816b16d51cf..53772aef5e048 100644 --- a/docs/platforms/javascript/common/configuration/integrations/bullmq.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/bullmq.mdx @@ -7,6 +7,7 @@ notSupported: - javascript.elysia - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx b/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx index e9625ae04a0bb..94fdcada58e99 100644 --- a/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx @@ -9,6 +9,7 @@ notSupported: - javascript.bun - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx b/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx index 7d65c8166a6df..947768b0545d4 100644 --- a/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx @@ -10,6 +10,7 @@ notSupported: - javascript.elysia - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/fetchIntegration.mdx b/docs/platforms/javascript/common/configuration/integrations/fetchIntegration.mdx index 45c28c87f3ad5..b8d7f11a26a05 100644 --- a/docs/platforms/javascript/common/configuration/integrations/fetchIntegration.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/fetchIntegration.mdx @@ -3,6 +3,7 @@ title: FetchIntegration description: "A default integration that creates spans and attaches tracing headers to fetch requests." supported: - javascript.cloudflare + - javascript.vinext - javascript.bun - javascript.elysia --- diff --git a/docs/platforms/javascript/common/configuration/integrations/firebase.mdx b/docs/platforms/javascript/common/configuration/integrations/firebase.mdx index 8ca0677ebd6a5..0f0df877db02f 100644 --- a/docs/platforms/javascript/common/configuration/integrations/firebase.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/firebase.mdx @@ -5,6 +5,7 @@ supportedCategories: - server notSupported: - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/fs.mdx b/docs/platforms/javascript/common/configuration/integrations/fs.mdx index 16e9abfc10d0b..190ba75dbd3db 100644 --- a/docs/platforms/javascript/common/configuration/integrations/fs.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/fs.mdx @@ -8,6 +8,7 @@ supported: notSupported: - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/http.mdx b/docs/platforms/javascript/common/configuration/integrations/http.mdx index c48e03947c242..bd4c75cc33b0c 100644 --- a/docs/platforms/javascript/common/configuration/integrations/http.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/http.mdx @@ -8,6 +8,7 @@ supported: notSupported: - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/index.mdx b/docs/platforms/javascript/common/configuration/integrations/index.mdx index f04c90272e3dd..9fe56a9d3271a 100644 --- a/docs/platforms/javascript/common/configuration/integrations/index.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/index.mdx @@ -38,7 +38,7 @@ Sentry.init({ - + For example, to stop recording breadcrumbs for outgoing HTTP requests: diff --git a/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx b/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx index 1a2a23f79a86b..c73f44636a6b7 100644 --- a/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx @@ -8,6 +8,7 @@ supported: notSupported: - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/mistral.mdx b/docs/platforms/javascript/common/configuration/integrations/mistral.mdx index af1af5c379507..ec058d2c2662e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/mistral.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/mistral.mdx @@ -70,7 +70,7 @@ The Mistral SDK must be part of the bundle. The plugin only runs during a build, - + On Cloudflare, add `sentryCloudflareVitePlugin()` alongside Cloudflare's Vite plugin so the bundled Mistral SDK is instrumented: diff --git a/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx b/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx index b3822c29a7f40..e534149252849 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx @@ -8,6 +8,7 @@ supported: notSupported: - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx b/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx index 4378b803b4a21..c63a110ba48d3 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx @@ -11,6 +11,7 @@ notSupported: - javascript.elysia - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx b/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx index 382573d4530d3..0fb0b81fe151b 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx @@ -10,6 +10,7 @@ notSupported: - javascript.elysia - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx b/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx index 628dc1f36e463..19deb9581a70e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx @@ -10,6 +10,7 @@ notSupported: - javascript.elysia - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/integrations/postgresjs.mdx b/docs/platforms/javascript/common/configuration/integrations/postgresjs.mdx index a88389d2dcab7..3c7b27da17f52 100644 --- a/docs/platforms/javascript/common/configuration/integrations/postgresjs.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/postgresjs.mdx @@ -13,7 +13,7 @@ The `instrumentPostgresJsSql` helper adds instrumentation for the [`postgres`](h ## Usage - + If you build your Worker with the Sentry Cloudflare Vite plugin, you don't need this helper. The plugin traces postgres.js automatically, as long as `postgres` is bundled and not marked as external. If you deploy with `wrangler` directly, wrap your `sql` instance with the helper: diff --git a/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx b/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx index 9fa53685351d4..62c17b4969710 100644 --- a/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/typesafe.mdx @@ -6,6 +6,7 @@ supportedCategories: - serverless notSupported: - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 8fdf533aa36af..81d4851e97311 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -288,7 +288,7 @@ Set this option to `false` to disable sending of client reports. Client reports Set this option to `true` to add stack local variables to stack traces. - + For more advanced configuration options, see the documentation on the Local Variables integration options. @@ -340,6 +340,7 @@ The callback gets a second argument (called a "hint") which contains the origina "javascript.elysia", "javascript.deno", "javascript.cloudflare", + "javascript.vinext", ]} > @@ -353,6 +354,7 @@ The callback gets a second argument (called a "hint") which contains the origina "javascript.elysia", "javascript.deno", "javascript.cloudflare", + "javascript.vinext", ]} > A `fetch`-based transport is used by default. @@ -370,7 +372,7 @@ The callback gets a second argument (called a "hint") which contains the origina Options used to configure the transport. This is an object with the following possible optional keys: - + @@ -386,11 +388,11 @@ Options used to configure the transport. This is an object with the following po - + - `headers`: An object containing headers to be sent with every request. - + - `fetchOptions`: An object containing options to be passed to the `fetch` call. - `fetch`: A custom `fetch` function to use for requests. @@ -623,7 +625,7 @@ If you want to disable trace propagation, you can set this option to `[]`. - + @@ -884,7 +886,7 @@ Controls whether the SDK sets up an OpenTelemetry tracer provider to capture spa Keep this option set to `false` if you manage your own OpenTelemetry tracer provider. - + This option is not available through `@sentry/cloudflare/request`. @@ -994,7 +996,7 @@ This option is required to enable profiling (default is `0`). Determines how profiling sessions are controlled. It has two modes: -- `'manual'` (default): You control when profiling starts and stops using the `startProfiler()` and `stopProfiler()` functions. In this mode, profile sampling is only affected by `profileSessionSampleRate`. Read more about these functions in the profiling API documentation. +- `'manual'` (default): You control when profiling starts and stops using the `startProfiler()` and `stopProfiler()` functions. In this mode, profile sampling is only affected by `profileSessionSampleRate`. Read more about these functions in the profiling API documentation. - `'trace'`: Profiling starts and stops automatically with transactions (or service spans if you're using stream mode), as long as tracing is enabled. The profiler runs as long as there is at least one sampled transaction. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`). @@ -1025,7 +1027,7 @@ This option is required to enable profiling (default is `0`). Determines how profiling sessions are controlled. It has two modes: -- `'manual'` (default): You control when profiling starts and stops using the `startProfiler()` and `stopProfiler()` functions. In this mode, profile sampling is only affected by `profileSessionSampleRate`. Read more about these functions in the profiling API documentation. +- `'manual'` (default): You control when profiling starts and stops using the `startProfiler()` and `stopProfiler()` functions. In this mode, profile sampling is only affected by `profileSessionSampleRate`. Read more about these functions in the profiling API documentation. - `'trace'`: Profiling starts and stops automatically with root spans, as long as tracing is enabled. The profiler runs while there is at least one active, sampled root span, up to a maximum of 5 minutes per root span. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`). diff --git a/docs/platforms/javascript/common/configuration/tunneling.mdx b/docs/platforms/javascript/common/configuration/tunneling.mdx index 4187caa8f3fd4..90773bcc1c22c 100644 --- a/docs/platforms/javascript/common/configuration/tunneling.mdx +++ b/docs/platforms/javascript/common/configuration/tunneling.mdx @@ -5,6 +5,8 @@ description: "Send browser SDK events to Sentry through your own server, so ad b supportedCategories: - browser - server +notSupported: + - javascript.vinext --- Ad blockers often block requests to Sentry, so your events never arrive. A tunnel is an endpoint on your own origin that forwards events to Sentry, and ad blockers let requests to your own origin through. diff --git a/docs/platforms/javascript/common/crons/index.mdx b/docs/platforms/javascript/common/crons/index.mdx index d66ae19055ebd..5d9dcfb43a187 100644 --- a/docs/platforms/javascript/common/crons/index.mdx +++ b/docs/platforms/javascript/common/crons/index.mdx @@ -10,7 +10,7 @@ supportedCategories: Once implemented, it'll allow you to get alerts and metrics to help you solve errors, detect timeouts, and prevent disruptions to your service. - + ## Requirements @@ -20,7 +20,7 @@ Once implemented, it'll allow you to get alerts and metrics to help you solve er - + ## Requirements diff --git a/docs/platforms/javascript/common/data-management/data-collected/index.mdx b/docs/platforms/javascript/common/data-management/data-collected/index.mdx index 6ecad2e604d42..54e1c29f9f0ae 100644 --- a/docs/platforms/javascript/common/data-management/data-collected/index.mdx +++ b/docs/platforms/javascript/common/data-management/data-collected/index.mdx @@ -103,7 +103,7 @@ Sentry.init({ The body size, taken from the `content-length` header, is always sent, even when body collection is disabled. - + On the server-side, the incoming request body is captured by default. You can disable sending the incoming request body by configuring `ignoreRequestBody` in the HTTP Integration. @@ -139,7 +139,7 @@ To disable source map upload, see the Source Map The Sentry SDK does not send local variables in the error stack trace in client-side JavaScript SDKs. - + You can enable sending local variables by setting `includeLocalVariables: true` in the `Sentry.init()` call. This activates the Local Variables Integration. The integration is added by default in Node.js-based runtimes. @@ -191,7 +191,7 @@ By default, the Sentry SDK sends information about the device and runtime to Sen - + ## Stack Trace Context Lines diff --git a/docs/platforms/javascript/common/data-management/data-collected/index__v10.x.mdx b/docs/platforms/javascript/common/data-management/data-collected/index__v10.x.mdx index 160e8712ffe7f..0de3f9df89590 100644 --- a/docs/platforms/javascript/common/data-management/data-collected/index__v10.x.mdx +++ b/docs/platforms/javascript/common/data-management/data-collected/index__v10.x.mdx @@ -117,7 +117,7 @@ Sentry.init({ The body size taken from the `content-length` header is always sent, even when the body itself is not captured. - + On the server-side, you can disable the incoming request body with `maxIncomingRequestBodySize: "none"`, or skip specific requests with `ignoreIncomingRequestBody`, in the HTTP Integration. @@ -153,7 +153,7 @@ To disable source map upload, see the Source Map The Sentry SDK does not send local variables in the error stack trace in client-side JavaScript SDKs. - + You can enable sending local variables by setting `includeLocalVariables: true` in the `Sentry.init()` call. This activates the Local Variables Integration. The integration is added by default in Node.js-based runtimes. @@ -177,7 +177,7 @@ By default, the Sentry SDK sends information about the device and runtime to Sen - + ## Session Replay @@ -203,7 +203,7 @@ By default, the Sentry SDK sends information about the device and runtime to Sen - + ## Stack Trace Context Lines diff --git a/docs/platforms/javascript/common/enriching-events/index.mdx b/docs/platforms/javascript/common/enriching-events/index.mdx index 4e72f2ab44f31..0866d6e0b13d4 100644 --- a/docs/platforms/javascript/common/enriching-events/index.mdx +++ b/docs/platforms/javascript/common/enriching-events/index.mdx @@ -70,7 +70,7 @@ All events have a fingerprint. Events with the same fingerprint are grouped toge When an event is captured and sent to Sentry, SDKs will merge that event data with extra information from the current scope. SDKs will typically automatically manage the scopes for you in the framework integrations and you don't need to think about them. However, if you want to better understand how scopes work and how you can leverage them for your use case, you can learn more about scopes. - + ## Request Isolation Learn more about how to isolate requests diff --git a/docs/platforms/javascript/common/index.mdx b/docs/platforms/javascript/common/index.mdx index 27e4d77056ae0..1d42467f84239 100644 --- a/docs/platforms/javascript/common/index.mdx +++ b/docs/platforms/javascript/common/index.mdx @@ -26,7 +26,7 @@ This guide focuses on plain JavaScript. If you're using a framework, select it t - + ## Features @@ -59,7 +59,7 @@ Select which Sentry features you'd like to install in addition to Error Monitori - + In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/profiling/). diff --git a/docs/platforms/javascript/common/install/bundler.mdx b/docs/platforms/javascript/common/install/bundler.mdx index 9127daac891d2..d1e5b0e6e7a7b 100644 --- a/docs/platforms/javascript/common/install/bundler.mdx +++ b/docs/platforms/javascript/common/install/bundler.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.bun - javascript.deno - javascript.cloudflare + - javascript.vinext - javascript.elysia - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/install/esm-without-import.mdx b/docs/platforms/javascript/common/install/esm-without-import.mdx index 07398d26b86e6..e00907985b7ba 100644 --- a/docs/platforms/javascript/common/install/esm-without-import.mdx +++ b/docs/platforms/javascript/common/install/esm-without-import.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.bun - javascript.deno - javascript.cloudflare + - javascript.vinext - javascript.elysia - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/install/index.mdx b/docs/platforms/javascript/common/install/index.mdx index 3b62bbe04f68b..abc26a4b7a894 100644 --- a/docs/platforms/javascript/common/install/index.mdx +++ b/docs/platforms/javascript/common/install/index.mdx @@ -32,6 +32,7 @@ notSupported: - javascript.aws-lambda - javascript.gcp-functions - javascript.cloudflare + - javascript.vinext - javascript.elysia - javascript.react-router - javascript.tanstackstart-react diff --git a/docs/platforms/javascript/common/install/late-initialization.mdx b/docs/platforms/javascript/common/install/late-initialization.mdx index 82c2383521493..b659232b0c28b 100644 --- a/docs/platforms/javascript/common/install/late-initialization.mdx +++ b/docs/platforms/javascript/common/install/late-initialization.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.bun - javascript.deno - javascript.cloudflare + - javascript.vinext - javascript.elysia - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/install/single-executable-applications.mdx b/docs/platforms/javascript/common/install/single-executable-applications.mdx index 0708fd187b8bd..88eb9c3a0c6e9 100644 --- a/docs/platforms/javascript/common/install/single-executable-applications.mdx +++ b/docs/platforms/javascript/common/install/single-executable-applications.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.bun - javascript.deno - javascript.cloudflare + - javascript.vinext - javascript.elysia - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx index 8b0c66648def5..cff01066d0071 100644 --- a/docs/platforms/javascript/common/logs/index.mdx +++ b/docs/platforms/javascript/common/logs/index.mdx @@ -18,7 +18,7 @@ Sentry Logs are **high-cardinality** — you can pass any attributes you want an Logs are enabled by default. Just initialize the SDK and use `Sentry.logger` to send logs. - + ```javascript Sentry.init({ @@ -28,7 +28,7 @@ Sentry.init({ - + ```typescript {filename:src/instrument.server.ts} import { defineCloudflareOptions } from "@sentry/cloudflare"; @@ -121,7 +121,7 @@ Multiple arguments are parsed as searchable attributes (requires SDK `10.13.0`+) For [Consola](https://github.com/unjs/consola) users, use `Sentry.createConsolaReporter()` instead (requires SDK `10.12.0`+). - + ```javascript Sentry.init({ @@ -139,7 +139,7 @@ console.log("Executed Action for User:", 123, true); - + ```typescript {filename:src/instrument.server.ts} import { @@ -168,7 +168,7 @@ Use `beforeSendLog` to filter or modify logs before they're sent. Return `null` The log object includes: `level`, `message`, `timestamp`, and `attributes`. - + ```javascript Sentry.init({ @@ -191,7 +191,7 @@ Sentry.init({ - + ```typescript {filename:src/instrument.server.ts} import { defineCloudflareOptions } from "@sentry/cloudflare"; diff --git a/docs/platforms/javascript/common/mcp-monitoring/index.mdx b/docs/platforms/javascript/common/mcp-monitoring/index.mdx index 8ff8b96d0a465..76fc4189d289d 100644 --- a/docs/platforms/javascript/common/mcp-monitoring/index.mdx +++ b/docs/platforms/javascript/common/mcp-monitoring/index.mdx @@ -48,7 +48,7 @@ const server = Sentry.wrapMcpServerWithSentry(mcpServer, { The `recordInputs` and `recordOutputs` options require Sentry JavaScript SDK version `10.33.0` or newer. In version 10, the SDK records inputs and outputs only when you set the `dataCollection` option or enable them on the wrapper. Starting with version 11, it records them by default. - + ## Preserve MCP Spans After the Response diff --git a/docs/platforms/javascript/common/migration/v10-to-v11/index.mdx b/docs/platforms/javascript/common/migration/v10-to-v11/index.mdx index de3dff34a2fda..c74815b8911f1 100644 --- a/docs/platforms/javascript/common/migration/v10-to-v11/index.mdx +++ b/docs/platforms/javascript/common/migration/v10-to-v11/index.mdx @@ -40,7 +40,7 @@ The [Interactive v11 Migration Guide](./interactive/) shows the steps for your s Version 11 has new compatibility ranges for runtimes, frameworks, and libraries. - + ### Node.js @@ -757,7 +757,7 @@ Instrumentation now runs through diagnostics channels (`orchestrion`) instead of The `vercelAIIntegration` is the exception. It no longer works on Vercel Edge, which doesn't support diagnostics channels, and it no longer enhances the native OpenTelemetry spans the `ai` package emits. Those spans are captured as they are, so some agent monitoring capabilities are lost. - + ### Initializing With `--require` Is No Longer Supported @@ -775,7 +775,7 @@ node --import ./instrument.js app.js - + ### Framework Errors Are Captured Automatically @@ -1014,7 +1014,7 @@ BrowserTracing now automatically adds the + ## Cloudflare Changes @@ -1483,7 +1483,7 @@ import type { BrowserClientReplayOptions } from "@sentry/core/browser"; - + ### Node.js and Server SDKs @@ -1519,7 +1519,7 @@ node --import @sentry/node/import app.js ### Profiling - + The legacy per-transaction profiling options were removed. Configure session-based profiling with `profileSessionSampleRate` and a `profileLifecycle` of `'trace'` or `'manual'` instead. The `prune-profiler-binaries` script was removed from `@sentry/profiling-node`. @@ -1553,7 +1553,7 @@ Sentry.init({ ``` - + ### The `childProcess` Integration Was Split diff --git a/docs/platforms/javascript/common/migration/v4-to-v5_v6.mdx b/docs/platforms/javascript/common/migration/v4-to-v5_v6.mdx index 6021869d90381..26354e8b7ddac 100644 --- a/docs/platforms/javascript/common/migration/v4-to-v5_v6.mdx +++ b/docs/platforms/javascript/common/migration/v4-to-v5_v6.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.capacitor - javascript.electron - javascript.cloudflare + - javascript.vinext - javascript.elysia --- diff --git a/docs/platforms/javascript/common/migration/v6-to-v7.mdx b/docs/platforms/javascript/common/migration/v6-to-v7.mdx index 2ca9877a99525..fee964c7566f7 100644 --- a/docs/platforms/javascript/common/migration/v6-to-v7.mdx +++ b/docs/platforms/javascript/common/migration/v6-to-v7.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.capacitor - javascript.electron - javascript.cloudflare + - javascript.vinext - javascript.elysia --- diff --git a/docs/platforms/javascript/common/migration/v7-to-v8/index.mdx b/docs/platforms/javascript/common/migration/v7-to-v8/index.mdx index 14ce80c421cb8..666617b3f1310 100644 --- a/docs/platforms/javascript/common/migration/v7-to-v8/index.mdx +++ b/docs/platforms/javascript/common/migration/v7-to-v8/index.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.capacitor - javascript.electron - javascript.cloudflare + - javascript.vinext - javascript.elysia --- diff --git a/docs/platforms/javascript/common/migration/v7-to-v8/v7-deprecations.mdx b/docs/platforms/javascript/common/migration/v7-to-v8/v7-deprecations.mdx index 9f31bf9e00015..93ed6d146a523 100644 --- a/docs/platforms/javascript/common/migration/v7-to-v8/v7-deprecations.mdx +++ b/docs/platforms/javascript/common/migration/v7-to-v8/v7-deprecations.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.capacitor - javascript.electron - javascript.cloudflare + - javascript.vinext - javascript.elysia --- diff --git a/docs/platforms/javascript/common/migration/v7-to-v8/v8-new-performance-api.mdx b/docs/platforms/javascript/common/migration/v7-to-v8/v8-new-performance-api.mdx index 23698fab6a21c..ad850660a4c3d 100644 --- a/docs/platforms/javascript/common/migration/v7-to-v8/v8-new-performance-api.mdx +++ b/docs/platforms/javascript/common/migration/v7-to-v8/v8-new-performance-api.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.capacitor - javascript.electron - javascript.cloudflare + - javascript.vinext - javascript.elysia --- diff --git a/docs/platforms/javascript/common/migration/v8-to-v9.mdx b/docs/platforms/javascript/common/migration/v8-to-v9.mdx index 1201de95745f7..de0c6773bcfe6 100644 --- a/docs/platforms/javascript/common/migration/v8-to-v9.mdx +++ b/docs/platforms/javascript/common/migration/v8-to-v9.mdx @@ -178,7 +178,7 @@ The changes outlined in this section describe in what way the SDK may behave dif - + - The `tracesSampler` hook will no longer be called for _every_ span. Root spans may however have incoming trace data from a different service, for example when using distributed tracing. @@ -343,7 +343,7 @@ The changes outlined in this section detail deprecated APIs that are now removed - The `sessionTimingIntegration` has been removed. To capture session durations alongside events, use Context (`Sentry.setContext()`). - + - The `addOpenTelemetryInstrumentation` method was removed. Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead. @@ -597,7 +597,7 @@ The following changes are unlikely to affect users of the SDK. They are listed h - `RequestSessionStatus` - + ### Removals in `@sentry/opentelemetry` diff --git a/docs/platforms/javascript/common/profiling/index.mdx b/docs/platforms/javascript/common/profiling/index.mdx index 09e0028d39ad5..239df988ada0e 100644 --- a/docs/platforms/javascript/common/profiling/index.mdx +++ b/docs/platforms/javascript/common/profiling/index.mdx @@ -9,6 +9,7 @@ notSupported: - javascript.capacitor - javascript.deno - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/session-replay/index.mdx b/docs/platforms/javascript/common/session-replay/index.mdx index f3229d5070955..fe51ee8f3f3ab 100644 --- a/docs/platforms/javascript/common/session-replay/index.mdx +++ b/docs/platforms/javascript/common/session-replay/index.mdx @@ -64,7 +64,7 @@ Session Replay only runs in the browser, so you only need to configure it in `in fallbackPlatform="javascript" /> - + ### Canvas Recording diff --git a/docs/platforms/javascript/common/sourcemaps/uploading/wrangler.mdx b/docs/platforms/javascript/common/sourcemaps/uploading/wrangler.mdx index a97c4358319ce..c27cd0ceec074 100644 --- a/docs/platforms/javascript/common/sourcemaps/uploading/wrangler.mdx +++ b/docs/platforms/javascript/common/sourcemaps/uploading/wrangler.mdx @@ -4,6 +4,7 @@ description: "Upload your Cloudflare Workers source maps using Wrangler and Sent sidebar_order: 10 supported: - javascript.cloudflare + - javascript.vinext --- diff --git a/docs/platforms/javascript/common/tracing/index.mdx b/docs/platforms/javascript/common/tracing/index.mdx index b78ee75642d2c..100b9063e359a 100644 --- a/docs/platforms/javascript/common/tracing/index.mdx +++ b/docs/platforms/javascript/common/tracing/index.mdx @@ -15,7 +15,7 @@ With [tracing](/product/dashboards/sentry-dashboards/), Sentry automatically tra If you’re adopting Tracing in a high-throughput environment, we recommend testing prior to deployment to ensure that your service’s performance characteristics maintain expectations. - + Sentry can integrate with OpenTelemetry. You can find more information about it diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index 546fddfd90cd8..db337d9d8f04a 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -546,7 +546,7 @@ Learn more about fixing these caching issues in the Cloudflare's [`waitUntil()`](https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/#contextwaituntil) lets work continue after the Worker returns a response. Whether those spans arrive depends on your trace lifecycle. diff --git a/docs/platforms/javascript/guides/vinext/index.mdx b/docs/platforms/javascript/guides/vinext/index.mdx new file mode 100644 index 0000000000000..4072d20d57220 --- /dev/null +++ b/docs/platforms/javascript/guides/vinext/index.mdx @@ -0,0 +1,72 @@ +--- +title: vinext +description: "Learn how to set up Sentry in your vinext application on Cloudflare Workers and capture your first errors and traces." +sdk: sentry.javascript.nextjs +fallbackGuide: javascript.cloudflare +icon: javascript-nextjs +runtime: cloudflare +categories: + - server + - server-only +keywords: + - vinext + - next.js + - cloudflare + - vite +--- + + + +[vinext](https://github.com/cloudflare/vinext) builds a Next.js application with Vite. This guide sets up Sentry for the server side of a vinext app that runs on Cloudflare Workers. + + + If you build your app with the OpenNext Cloudflare adapter, follow the + [Next.js on + Cloudflare](/platforms/javascript/guides/nextjs/manual-setup/cloudflare/) + guide instead. + + +## Prerequisites + +You need: + +- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/) +- A vinext application that runs on Cloudflare Workers with the [Cloudflare Vite plugin](https://developers.cloudflare.com/workers/vite-plugin/) + + + +## Install + + + + + + + +## Control the Data You Send to Sentry (Optional) + + + +## Verify Your Setup + +The `sentry init` command checks the integration files it creates or modifies before it finishes. To confirm that runtime events reach Sentry, send a test error. + + + +## Next Steps + +At this point, you should have integrated Sentry into the server side of your vinext application on Cloudflare Workers. Here's what to explore next: + +- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup +- Distributed Tracing to trace requests across services +- [Vite Plugin](/platforms/javascript/guides/cloudflare/install/vite-plugin/) to see what the Sentry plugin instruments and how to configure it + + + +- If `sentry init` doesn't work for your project, follow the [Cloudflare manual setup](/platforms/javascript/guides/vinext/manual-setup/cloudflare/) guide +- Find various topics in Troubleshooting +- [Get support](https://www.sentry.help/en/) + + + + diff --git a/docs/platforms/javascript/guides/vinext/manual-setup/cloudflare.mdx b/docs/platforms/javascript/guides/vinext/manual-setup/cloudflare.mdx new file mode 100644 index 0000000000000..e1628e49da144 --- /dev/null +++ b/docs/platforms/javascript/guides/vinext/manual-setup/cloudflare.mdx @@ -0,0 +1,122 @@ +--- +title: vinext on Cloudflare +sidebar_title: Cloudflare +sidebar_order: 1 +description: "Learn how to manually set up Sentry in your vinext application on Cloudflare Workers." +runtime: cloudflare +--- + + + + + +## Prerequisites + +You need: + +- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/) +- A vinext application that runs on Cloudflare Workers with the [Cloudflare Vite plugin](https://developers.cloudflare.com/workers/vite-plugin/) + + + +## Install + +Install `@sentry/nextjs` and `@sentry/cloudflare`. Your Vite config imports the Sentry Vite plugin from `@sentry/cloudflare`: + +```bash {tabTitle:npm} +npm install @sentry/nextjs @sentry/cloudflare --save +``` + +```bash {tabTitle:yarn} +yarn add @sentry/nextjs @sentry/cloudflare +``` + +```bash {tabTitle:pnpm} +pnpm add @sentry/nextjs @sentry/cloudflare +``` + +## Configure + +### Add the Vite Plugin + +Add the Sentry plugin to your `vite.config.ts`, after `vinext()` and `cloudflare()`. At build time, the plugin wraps your Worker entry with `withSentry` from `@sentry/nextjs/cloudflare`, so you don't need to change the entry yourself. + +```typescript {filename:vite.config.ts} {diff} + import { cloudflare } from "@cloudflare/vite-plugin"; ++import { sentryCloudflareVitePlugin } from "@sentry/cloudflare/vite"; + import vinext from "vinext"; + import { defineConfig } from "vite"; + + export default defineConfig({ + plugins: [ + vinext(), + cloudflare({ viteEnvironment: { name: "rsc", childEnvironments: ["ssr"] } }), ++ sentryCloudflareVitePlugin(), + ], + }); +``` + +Each request gets one `http.server` span with the name of the Next.js route, and the Next.js spans become its children. To see the options of the plugin, see [Vite Plugin](/platforms/javascript/guides/cloudflare/install/vite-plugin/). + +### Configure Wrangler + + + +### Add Your Sentry Options + +Create an `instrument.server.ts` file next to your Worker entry, the file that `main` points at in your Wrangler configuration. If `main` is `worker/index.ts`, the file belongs at `worker/instrument.server.ts`, not at the project root. + +The name is fixed. The plugin passes the default export of this file to `withSentry`. Use `defineCloudflareOptions` to get the options type-checked. + +```typescript {filename:worker/instrument.server.ts} +import { defineCloudflareOptions } from "@sentry/nextjs/cloudflare"; + +export default defineCloudflareOptions((env) => ({ + dsn: "___PUBLIC_DSN___", + + // Enables Tracing. + // Set to 1.0 to capture 100% of spans for tracing. + // We recommend reducing this value in production. + tracesSampleRate: 1.0, +})); +``` + +You don't need `sentry.server.config.ts` or `sentry.edge.config.ts`. If your app has these files, `Sentry.init()` in them creates no client in the Worker, and the options of `instrument.server.ts` apply. + +### Capture Server Errors + +vinext handles errors from Server Components and route handlers itself, so they don't reach the Worker entry. Export `onRequestError` from the [instrumentation file](https://nextjs.org/docs/app/guides/instrumentation) in your project's root directory (or `src` folder) to send them to Sentry: + +```typescript {filename:instrumentation.ts} +import * as Sentry from "@sentry/nextjs"; + +export const onRequestError = Sentry.captureRequestError; +``` + +### Control the Data You Send to Sentry + + + +## Verify Your Setup + + + +## Next Steps + +At this point, you should have integrated Sentry into the server side of your vinext application on Cloudflare Workers. Here's what to explore next: + +- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup +- Distributed Tracing to trace requests across services +- [Vite Plugin](/platforms/javascript/guides/cloudflare/install/vite-plugin/) to see what the Sentry plugin instruments and how to configure it + + + +- Find various topics in Troubleshooting +- [Get support](https://www.sentry.help/en/) + + + + diff --git a/docs/platforms/javascript/guides/vinext/manual-setup/index.mdx b/docs/platforms/javascript/guides/vinext/manual-setup/index.mdx new file mode 100644 index 0000000000000..2c1dd21160386 --- /dev/null +++ b/docs/platforms/javascript/guides/vinext/manual-setup/index.mdx @@ -0,0 +1,11 @@ +--- +title: Manual Setup +sidebar_order: 1 +description: "Learn how to set up Sentry in your vinext application yourself, without `sentry init`." +--- + + + +To set up Sentry yourself, you install the Sentry packages, add the Sentry Vite plugin, set your Sentry options, and capture the server errors that vinext handles itself. The steps depend on the runtime your vinext app runs on: + +- [Cloudflare](/platforms/javascript/guides/vinext/manual-setup/cloudflare/): for a vinext app on Cloudflare Workers, built with the Cloudflare Vite plugin diff --git a/includes/quick-start-features-expandable.mdx b/includes/quick-start-features-expandable.mdx index 5a5698e0cdae6..e9bde61f4fa6b 100644 --- a/includes/quick-start-features-expandable.mdx +++ b/includes/quick-start-features-expandable.mdx @@ -45,7 +45,7 @@ import { FeatureInfo } from "sentry-docs/components/featureInfo"; - + diff --git a/includes/quick-start-locate-data-expandable.mdx b/includes/quick-start-locate-data-expandable.mdx index 9261830f389aa..fda0750ad6f0f 100644 --- a/includes/quick-start-locate-data-expandable.mdx +++ b/includes/quick-start-locate-data-expandable.mdx @@ -36,7 +36,7 @@ import { FeatureInfo } from "sentry-docs/components/featureInfo"; - + diff --git a/platform-includes/configuration/auto-session-tracking/javascript.mdx b/platform-includes/configuration/auto-session-tracking/javascript.mdx index 83935c52086d4..da85fbc7e8232 100644 --- a/platform-includes/configuration/auto-session-tracking/javascript.mdx +++ b/platform-includes/configuration/auto-session-tracking/javascript.mdx @@ -23,7 +23,7 @@ Sentry.init({ - + By default, the Node.js-based SDKs are sending sessions. Sessions are created for every incoming request. diff --git a/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx b/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx index d797e90155163..3199e68957f33 100644 --- a/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx +++ b/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx @@ -3,7 +3,7 @@ You need: - A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/) -- A Next.js application that runs on Cloudflare Workers with the [OpenNext Cloudflare adapter](https://opennext.js.org/cloudflare) or [vinext](https://github.com/cloudflare/vinext) +- A Next.js application that runs on Cloudflare Workers with the [OpenNext Cloudflare adapter](https://opennext.js.org/cloudflare) If you haven't deployed a Next.js app to Cloudflare Workers before, follow @@ -12,6 +12,12 @@ You need: first. + + If you build your app with [vinext](https://github.com/cloudflare/vinext), + follow the [vinext on Cloudflare](/platforms/javascript/guides/vinext/) guide + instead. + + ## Install @@ -62,8 +68,6 @@ compatibility_date = "2025-08-16" -If you build your app with vinext, skip to [Wrap the Worker Entry With vinext](#wrap-the-worker-entry-with-vinext). - On Cloudflare Workers, your Next.js app runs inside the Worker entry that OpenNext generates (`.open-next/worker.js`). Wrap this entry with `withSentry` from `@sentry/nextjs/cloudflare` to get the same Next.js spans as on Node.js, plus Cloudflare data such as spans for D1 queries. Each request gets one `http.server` span with the name of the Next.js route, and the Next.js spans become its children. `@sentry/nextjs` depends on `@sentry/cloudflare`, so you don't need to install another package. @@ -104,10 +108,6 @@ Then, point `main` in your Wrangler configuration to this file: main = "./worker.ts" ``` -#### Wrap the Worker Entry With vinext - -With [vinext](https://github.com/cloudflare/vinext), you don't need a custom Worker. Add the [Sentry Vite plugin](/platforms/javascript/guides/cloudflare/install/vite-plugin/) to your Vite config, and it wraps your Worker entry with `withSentry` from `@sentry/nextjs/cloudflare` automatically. - #### Server and Edge Configuration in the Worker In the Worker, `withSentry` creates the Sentry client. `Sentry.init()` in `sentry.server.config.ts` and `sentry.edge.config.ts` still runs, but it creates no client and only applies the `release` option. Set all other options in `withSentry`. diff --git a/platform-includes/getting-started-data-collection/javascript.vinext.mdx b/platform-includes/getting-started-data-collection/javascript.vinext.mdx new file mode 100644 index 0000000000000..d3e41a19a64ce --- /dev/null +++ b/platform-includes/getting-started-data-collection/javascript.vinext.mdx @@ -0,0 +1,19 @@ +By default, the SDK sends user identity data (IP address, ID, and similar) and other data like HTTP bodies and URL query parameters. +This will give you rich debugging context. + +The SDK always filters sensitive values whose keys match a built-in denylist, such as `auth` or `password`, and sends `[Filtered]` instead. + +To send less data, turn off the categories you don't need in the `dataCollection` option in `instrument.server.ts`, next to your Worker entry. +For the full list of categories and their defaults, see the `dataCollection` options. + +```typescript {filename:worker/instrument.server.ts} {5-7} +import { defineCloudflareOptions } from "@sentry/nextjs/cloudflare"; + +export default defineCloudflareOptions((env) => ({ + dsn: "___PUBLIC_DSN___", + dataCollection: { + userInfo: false, + // other categories + }, +})); +``` diff --git a/platform-includes/getting-started-verify/javascript.vinext.mdx b/platform-includes/getting-started-verify/javascript.vinext.mdx new file mode 100644 index 0000000000000..d61e38668f4fc --- /dev/null +++ b/platform-includes/getting-started-verify/javascript.vinext.mdx @@ -0,0 +1,25 @@ +Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project. + +1. Add a route handler that throws an error: + + ```typescript {filename:app/api/sentry-example-api/route.ts} + export const dynamic = "force-dynamic"; + + export async function GET() { + throw new Error("Sentry Test Error"); + } + ``` + +2. Build your app and run it in the Workers runtime on your machine: + + ```bash + npx vinext build && npx wrangler dev --config dist/server/wrangler.json + ``` + +3. Open `/api/sentry-example-api` on the URL that the command prints. + +### View Captured Data in Sentry + +Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear). The error and the trace of the request have the same trace ID. + + diff --git a/platform-includes/sentry-init/how-it-works/javascript.vinext.mdx b/platform-includes/sentry-init/how-it-works/javascript.vinext.mdx new file mode 100644 index 0000000000000..eba2c1d31f5ae --- /dev/null +++ b/platform-includes/sentry-init/how-it-works/javascript.vinext.mdx @@ -0,0 +1,14 @@ + + +The `sentry init` command is AI-powered. It analyzes your project and generates a tailored integration, rather than applying a fixed template. Here's what it does: + +- **Analyzes your project**: reads project files and manifests to understand your app structure, including monorepos. It also respects AI instruction files such as `CLAUDE.md`, `AGENTS.md`, and `.cursorrules`. +- **Selects the SDK**: picks the Sentry SDK that fits your project. +- **Fetches official Sentry docs**: uses the current Sentry documentation as the source of truth when generating integration code. +- **Installs dependencies**: adds the Sentry packages using your project's package manager. +- **Creates and modifies files**: sets up Sentry based on your project structure. +- **Verifies the integration**: re-reads modified files after writing to confirm Sentry was integrated. + +For full details on what each file does, see the Cloudflare manual setup guide. + + diff --git a/platform-includes/sentry-init/manual-setup-callout/javascript.vinext.mdx b/platform-includes/sentry-init/manual-setup-callout/javascript.vinext.mdx new file mode 100644 index 0000000000000..74e4569bb923d --- /dev/null +++ b/platform-includes/sentry-init/manual-setup-callout/javascript.vinext.mdx @@ -0,0 +1,5 @@ + + Looking for automatic setup with `sentry init`? Follow + the vinext quickstart instead. + Continue with this guide to set up Sentry manually. + diff --git a/src/components/frameworkSelector/frameworks.ts b/src/components/frameworkSelector/frameworks.ts index 6644f616fa533..62e3abc7f24be 100644 --- a/src/components/frameworkSelector/frameworks.ts +++ b/src/components/frameworkSelector/frameworks.ts @@ -142,6 +142,7 @@ export const RUNTIMES: Record = { guide('Remix', 'remix/manual-setup/cloudflare'), guide('SvelteKit', 'sveltekit/manual-setup/cloudflare'), guide('TanStack Start', 'tanstackstart-react/manual-setup/cloudflare'), + guide('vinext', 'vinext/manual-setup/cloudflare', 'javascript-nextjs'), ], agentGuides: [ guide('Flue', 'flue/manual-setup/cloudflare'), diff --git a/src/components/runtimeLinks.spec.ts b/src/components/runtimeLinks.spec.ts index 3743dd10bfbcb..ede607929c028 100644 --- a/src/components/runtimeLinks.spec.ts +++ b/src/components/runtimeLinks.spec.ts @@ -55,12 +55,14 @@ describe('getRuntimeLinks', () => { }); describe('getQuickStartTitle', () => { - it('names the runtime of the guide page if the guide has quick starts for more runtimes', () => { + it('names the runtime of the guide page', () => { expect(getQuickStartTitle(piDurable)).toBe('Quick Start (Node.js)'); + expect(getQuickStartTitle(page(`${G}/vinext`, 'cloudflare'))).toBe( + 'Quick Start (Cloudflare)' + ); }); - it('returns "Quick Start" for a guide with quick starts for fewer than two runtimes', () => { - expect(getQuickStartTitle(page(`${G}/node`, 'node'))).toBe('Quick Start'); + it('returns "Quick Start" if the guide page sets no runtime', () => { expect(getQuickStartTitle(page(`${G}/eve`))).toBe('Quick Start'); expect(getQuickStartTitle(undefined)).toBe('Quick Start'); }); diff --git a/src/components/runtimeLinks.ts b/src/components/runtimeLinks.ts index 0f4f2eac957a5..c8f8d2c290933 100644 --- a/src/components/runtimeLinks.ts +++ b/src/components/runtimeLinks.ts @@ -67,13 +67,11 @@ export function getRuntimeLinks( } /** - * Returns the sidebar title of the guide page of `guide`: "Quick Start", or - * "Quick Start ()", for example "Quick Start (Node.js)", if the guide has quick - * starts for more than one runtime. + * Returns the sidebar title of the guide page of `guide`: "Quick Start ()", for + * example "Quick Start (Node.js)", if the guide page sets `runtime` in its frontmatter, or else + * "Quick Start". */ export function getQuickStartTitle(guide: QuickStartNode | undefined): string { - const runtime = getRuntimeLinks(guide, [])?.find( - link => link.url === `/${guide?.path}/` - )?.title; - return runtime ? `Quick Start (${runtime})` : 'Quick Start'; + const runtime = guide?.frontmatter.runtime; + return runtime ? `Quick Start (${getRuntimeTitle(runtime)})` : 'Quick Start'; }