From db97df3f0f134b7ac74af215ec9ca2ec73451947 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Fri, 25 Jul 2025 11:40:01 +0200 Subject: [PATCH] feat(js): Switch to non experimental option for logs --- .../guides/angular/manual-setup.mdx | 12 +++-- .../javascript/guides/astro/index.mdx | 50 ++++++++++++------- .../javascript/guides/cloudflare/index.mdx | 14 +++--- .../javascript/guides/ember/index.mdx | 20 +++++--- .../javascript/guides/gatsby/index.mdx | 17 +++++-- .../javascript/guides/nextjs/index.mdx | 14 ++++-- .../javascript/guides/nextjs/manual-setup.mdx | 16 +++--- .../javascript/guides/nuxt/manual-setup.mdx | 4 +- .../javascript/guides/react-router/index.mdx | 6 +-- .../javascript/guides/react/index.mdx | 11 +++- .../javascript/guides/remix/manual-setup.mdx | 13 +++-- .../javascript/guides/solid/index.mdx | 21 +++++--- .../javascript/guides/svelte/index.mdx | 14 ++++-- .../guides/sveltekit/manual-setup.mdx | 4 +- .../guides/tanstackstart-react/index.mdx | 40 +++++++++------ .../platforms/javascript/guides/vue/index.mdx | 4 +- .../javascript.cloudflare.workers.mdx | 2 +- .../getting-started-config/javascript.mdx | 24 ++++----- .../javascript.node.mdx | 10 ++-- .../llm-rules-logs/javascript.nextjs.mdx | 9 ++-- .../llm-rules-logs/javascript.node.mdx | 9 ++-- .../llm-rules-logs/javascript.react.mdx | 9 ++-- .../llm-rules-platform/_default.mdx | 11 ++-- .../llm-rules-platform/javascript.nextjs.mdx | 12 ++--- .../llm-rules-platform/javascript.node.mdx | 10 ++-- .../llm-rules-platform/javascript.react.mdx | 10 ++-- 26 files changed, 216 insertions(+), 150 deletions(-) diff --git a/docs/platforms/javascript/guides/angular/manual-setup.mdx b/docs/platforms/javascript/guides/angular/manual-setup.mdx index 52710f4ed61115..14107a5273ede1 100644 --- a/docs/platforms/javascript/guides/angular/manual-setup.mdx +++ b/docs/platforms/javascript/guides/angular/manual-setup.mdx @@ -24,7 +24,13 @@ You need: Choose the features you want to configure, and this guide will show you how: @@ -133,7 +139,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); @@ -198,7 +204,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); diff --git a/docs/platforms/javascript/guides/astro/index.mdx b/docs/platforms/javascript/guides/astro/index.mdx index 6cc9947d70eccd..8a9e9f56164828 100644 --- a/docs/platforms/javascript/guides/astro/index.mdx +++ b/docs/platforms/javascript/guides/astro/index.mdx @@ -17,16 +17,25 @@ This page walks you through adding Sentry to your Astro project, configuring it, Before we get started, make sure you have the following: -* You need a Sentry [account](https://sentry.io/signup/) and [project](/product/projects/) -* An Astro project that uses Astro `3.0.0` or newer. -* A Node runtime: - * This SDK currently only works on Node runtimes (e.g. Node adapter, Vercel with Lambda functions). -Non-Node runtimes, like Vercel's Edge runtime or Cloudflare Pages, are currently not supported. -* If you're using Astro's Netflify adapter (`@astrojs/netlify`), you need version `5.0.0` or newer. +- You need a Sentry [account](https://sentry.io/signup/) and [project](/product/projects/) +- An Astro project that uses Astro `3.0.0` or newer. +- A Node runtime: + - This SDK currently only works on Node runtimes (e.g. Node adapter, Vercel with Lambda functions). + Non-Node runtimes, like Vercel's Edge runtime or Cloudflare Pages, are currently not supported. +- If you're using Astro's Netflify adapter (`@astrojs/netlify`), you need version `5.0.0` or newer. ## Install - + Sentry captures data by using an SDK within your application's runtime. @@ -70,7 +79,6 @@ To set up the Sentry SDK, register the Sentry integration and initialize the SDK ### Astro Integration Setup - ```javascript {filename:astro.config.mjs} import { defineConfig } from "astro/config"; import sentry from "@sentry/astro"; @@ -89,8 +97,12 @@ export default defineConfig({ ``` - Passing runtime-specific configuration options (`dsn`, `release`, `environment`, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`, `replaysOnErrorSampleRate`) to the Sentry integration will be deprecated in future versions. - We recommend passing your configuration directly to the respective `Sentry.init()` calls in `sentry.client.config.js` and `sentry.server.config.js` instead. + Passing runtime-specific configuration options (`dsn`, `release`, + `environment`, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`, + `replaysOnErrorSampleRate`) to the Sentry integration will be deprecated in + future versions. We recommend passing your configuration directly to the + respective `Sentry.init()` calls in `sentry.client.config.js` and + `sentry.server.config.js` instead. ### Client-Side Setup @@ -122,7 +134,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -148,7 +160,7 @@ Sentry.init({ ```javascript {filename:sentry.server.config.js} import * as Sentry from "@sentry/astro"; // ___PRODUCT_OPTION_START___ profiling -import { nodeProfilingIntegration } from '@sentry/profiling-node'; +import { nodeProfilingIntegration } from "@sentry/profiling-node"; // ___PRODUCT_OPTION_END___ profiling Sentry.init({ @@ -167,7 +179,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -179,7 +191,7 @@ Sentry.init({ // Set sampling rate for profiling // This is relative to tracesSampleRate - profilesSampleRate: 1.0 + profilesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling }); ``` @@ -211,13 +223,13 @@ Trigger a test error somewhere in your Astro app, for example in one of your pag ``` - Errors triggered from within Browser DevTools are sandboxed and won't trigger an error handler. - Place the snippet directly in your code instead. + Errors triggered from within Browser DevTools are sandboxed and won't trigger + an error handler. Place the snippet directly in your code instead. - Learn more about manually capturing an error or message in our Usage - documentation. + Learn more about manually capturing an error or message in our{" "} + Usage documentation. To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved. @@ -245,7 +257,7 @@ export default defineConfig({ - Auto instrumentation only works for Astro 3.5.2 or newer. If you're using an older version, you need to [manually add the Sentry middleware](#manually-add-server-instrumentation) instead. +Auto instrumentation only works for Astro 3.5.2 or newer. If you're using an older version, you need to [manually add the Sentry middleware](#manually-add-server-instrumentation) instead. diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx index 599e75a45077d1..3dc50d6bbb8c61 100644 --- a/docs/platforms/javascript/guides/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/cloudflare/index.mdx @@ -9,10 +9,9 @@ categories: - serverless --- - You can use the Sentry Cloudflare SDK with popular frameworks running on Cloudflare: -- **[Astro](frameworks/astro/)** +- **[Astro](frameworks/astro/)** - **[Hono](frameworks/hono/)** - **[Remix](frameworks/remix/)** - **[SvelteKit](frameworks/sveltekit/)** @@ -41,7 +40,10 @@ Select which Sentry features you'd like to install in addition to Error Monitori ### Setup (Cloudflare Workers) - + If you do not have access to the `onRequest` middleware API, you can use the `wrapRequestHandler` API instead. For example: @@ -81,14 +83,14 @@ export const onRequest = [ dsn: "___PUBLIC_DSN___", release: versionId, - + // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/guides/cloudflare/configuration/options/#sendDefaultPii sendDefaultPii: true, // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -97,7 +99,7 @@ export const onRequest = [ // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance - } + }; }), // Add more middlewares here ]; diff --git a/docs/platforms/javascript/guides/ember/index.mdx b/docs/platforms/javascript/guides/ember/index.mdx index 5edbd3a6cb3c03..e4de94aade84ce 100644 --- a/docs/platforms/javascript/guides/ember/index.mdx +++ b/docs/platforms/javascript/guides/ember/index.mdx @@ -8,7 +8,7 @@ categories: - Sentry's Ember addon enables automatic reporting of errors, exceptions, and transactions. +Sentry's Ember addon enables automatic reporting of errors, exceptions, and transactions. @@ -24,7 +24,15 @@ Select which Sentry features you'd like to install in addition to Error Monitori ## Install - + Sentry captures data by using an SDK within your application's runtime. @@ -46,11 +54,11 @@ import * as Sentry from "@sentry/ember"; Sentry.init({ dsn: "___PUBLIC_DSN___", - + // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/guides/ember/configuration/options/#sendDefaultPii sendDefaultPii: true, - + // ___PRODUCT_OPTION_START___ session-replay integrations: [ Sentry.replayIntegration(), @@ -65,7 +73,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -96,7 +104,7 @@ export default class App extends Application { - This SDK uses Ember configuration conventions to manage its automatic instrumentation and other Sentry options. This additional configuration can be found under Ember options. +This SDK uses Ember configuration conventions to manage its automatic instrumentation and other Sentry options. This additional configuration can be found under Ember options. diff --git a/docs/platforms/javascript/guides/gatsby/index.mdx b/docs/platforms/javascript/guides/gatsby/index.mdx index e6842ef532ec87..46f1d1b8d891cd 100644 --- a/docs/platforms/javascript/guides/gatsby/index.mdx +++ b/docs/platforms/javascript/guides/gatsby/index.mdx @@ -15,7 +15,15 @@ Select which Sentry features you'd like to install in addition to Error Monitori ## Install - + To use Sentry with your Gatsby application, you will need to use `@sentry/gatsby` (Sentry's Gatsby SDK): @@ -53,17 +61,16 @@ module.exports = { Then, configure your `Sentry.init`. For this, create a new file called `sentry.config.js` in the root of your project and add the following code: - ```javascript {filename:sentry.config.(js|ts)} import * as Sentry from "@sentry/gatsby"; Sentry.init({ dsn: "___PUBLIC_DSN___", - + // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/guides/gatsby/configuration/options/#sendDefaultPii sendDefaultPii: true, - + integrations: [ // ___PRODUCT_OPTION_START___ performance Sentry.browserTracingIntegration(), @@ -81,7 +88,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance diff --git a/docs/platforms/javascript/guides/nextjs/index.mdx b/docs/platforms/javascript/guides/nextjs/index.mdx index 7e01df44ba11bc..97602d8a94f465 100644 --- a/docs/platforms/javascript/guides/nextjs/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/index.mdx @@ -20,7 +20,13 @@ In addition to capturing errors, you can monitor interactions between multiple s Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. ## Step 1: Install @@ -82,7 +88,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -94,7 +100,7 @@ Sentry.init({ tracesSampleRate: 1.0, // ___PRODUCT_OPTION_END___ performance // ___PRODUCT_OPTION_START___ session-replay - // Capture Replay for 10% of all + // Capture Replay for 10% of all // plus for 100% of sessions with an error // Learn more at // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration @@ -118,7 +124,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup.mdx index fccd01f0959dcc..092f6597dacb22 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -151,7 +151,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // Note: if you want to override the automatic release value, do not set a // `release` value here - use the environment variable `SENTRY_RELEASE`, so @@ -184,7 +184,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ... @@ -216,7 +216,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ... @@ -459,6 +459,7 @@ Make sure to keep your auth token secret and out of version control. You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnelRoute` option to add an API endpoint in your application that forwards Sentry events to Sentry servers. For better ad-blocker evasion, you can either: + - Set `tunnelRoute: true` to automatically generate a random tunnel route for each build, making it harder for ad-blockers to detect and block monitoring requests - Set `tunnelRoute: "/my-tunnel-route"` to use a static route of your choosing @@ -481,9 +482,12 @@ module.exports = withSentryConfig(nextConfig, { ``` - If you're using Turbopack, client-side event recording will fail if your Next.js middleware intercepts the configured tunnel route. To fix this, set the route to a fixed string (like `/error-monitoring`) and add a negative matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel route. - - If you're not using Turbopack, Sentry will automatically skip the tunnel route in your middleware. + If you're using Turbopack, client-side event recording will fail if your + Next.js middleware intercepts the configured tunnel route. To fix this, set + the route to a fixed string (like `/error-monitoring`) and add a negative + matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel + route. If you're not using Turbopack, Sentry will automatically skip the + tunnel route in your middleware. ## Step 6: Instrument Vercel Cron Jobs (Optional) diff --git a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx index e41f7aa9c50033..22d0d0ebfd88be 100644 --- a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx @@ -112,7 +112,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); ``` @@ -155,7 +155,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); ``` diff --git a/docs/platforms/javascript/guides/react-router/index.mdx b/docs/platforms/javascript/guides/react-router/index.mdx index c6454579c01235..91b68566626667 100644 --- a/docs/platforms/javascript/guides/react-router/index.mdx +++ b/docs/platforms/javascript/guides/react-router/index.mdx @@ -118,7 +118,7 @@ Initialize the Sentry React SDK in your `entry.client.tsx` file: + // ___PRODUCT_OPTION_START___ logs + + // Enable logs to be sent to Sentry -+ _experiments: { enableLogs: true }, ++ enableLogs: true, + // ___PRODUCT_OPTION_END___ logs + // ___PRODUCT_OPTION_START___ performance + @@ -246,7 +246,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ profiling @@ -446,7 +446,7 @@ export default { buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => { // ... // Call this at the end of the hook -+ (await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest })); + +(await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest })); }, } satisfies Config; ``` diff --git a/docs/platforms/javascript/guides/react/index.mdx b/docs/platforms/javascript/guides/react/index.mdx index 06b2cc6ef21415..c87a1ab2890cc9 100644 --- a/docs/platforms/javascript/guides/react/index.mdx +++ b/docs/platforms/javascript/guides/react/index.mdx @@ -20,7 +20,13 @@ categories: Choose the features you want to configure, and this guide will show you how: @@ -81,7 +87,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -120,6 +126,7 @@ const container = document.getElementById(“app”); const root = createRoot(container); root.render(); ``` + ## Capture React Errors diff --git a/docs/platforms/javascript/guides/remix/manual-setup.mdx b/docs/platforms/javascript/guides/remix/manual-setup.mdx index fce4b28a118455..41ae1876ec09f5 100644 --- a/docs/platforms/javascript/guides/remix/manual-setup.mdx +++ b/docs/platforms/javascript/guides/remix/manual-setup.mdx @@ -16,7 +16,14 @@ description: "Learn how to manually set up Sentry in your Remix app and capture Choose the features you want to configure, and this guide will show you how: @@ -98,7 +105,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); ``` @@ -182,7 +189,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // Optionally capture action formData attributes with errors. diff --git a/docs/platforms/javascript/guides/solid/index.mdx b/docs/platforms/javascript/guides/solid/index.mdx index 25da692de4f2f4..5e1ffb65335459 100644 --- a/docs/platforms/javascript/guides/solid/index.mdx +++ b/docs/platforms/javascript/guides/solid/index.mdx @@ -16,7 +16,15 @@ Select which Sentry features you'd like to install in addition to Error Monitori ## Install - + Sentry captures data by using an SDK within your application's runtime. @@ -38,10 +46,7 @@ Configuration should happen as early as possible in your application's lifecycle To use the SDK, initialize it in your Solid entry point before bootstrapping your app. In a typical Solid project, that is your `index.jsx` file. - - We currently support Solid 1.8.4 and up. - - +We currently support Solid 1.8.4 and up. ```javascript {filename: index.jsx} import * as Sentry from "@sentry/solid"; @@ -56,11 +61,11 @@ import App from "./app"; if (!DEV) { Sentry.init({ dsn: "___PUBLIC_DSN___", - + // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/guides/solid/configuration/options/#sendDefaultPii sendDefaultPii: true, - + integrations: [ // ___PRODUCT_OPTION_START___ performance solidRouterBrowserTracingIntegration(), @@ -78,7 +83,7 @@ if (!DEV) { // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance diff --git a/docs/platforms/javascript/guides/svelte/index.mdx b/docs/platforms/javascript/guides/svelte/index.mdx index 29a90deefe55a7..c25b93d7fea238 100644 --- a/docs/platforms/javascript/guides/svelte/index.mdx +++ b/docs/platforms/javascript/guides/svelte/index.mdx @@ -18,7 +18,13 @@ categories: Choose the features you want to configure, and this guide will show you how: @@ -38,6 +44,7 @@ yarn add @sentry/svelte ```bash {tabTitle:pnpm} pnpm add @sentry/svelte ``` + @@ -78,7 +85,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -136,7 +143,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -167,6 +174,7 @@ const app = new App({ export default app; ``` + diff --git a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx index 8759d5eaa3f312..d8e66a7f1808a0 100644 --- a/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx +++ b/docs/platforms/javascript/guides/sveltekit/manual-setup.mdx @@ -94,7 +94,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); @@ -133,7 +133,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs }); diff --git a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx index c2e315fee6b41b..1370f4f08a1f8c 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx @@ -5,15 +5,14 @@ description: "Learn how to set up and configure Sentry in your TanStack Start Re - This SDK is currently in **ALPHA**. Alpha features are still in progress, may have bugs and might include breaking changes. - Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns. - This SDK is for [TanStack Start (React)](https://tanstack.com/start/latest/docs/framework/react/overview), for - using [TanStack Router (React)](https://tanstack.com/router/latest/docs/framework/react/overview) see our React docs for - [TanStack Router](/platforms/javascript/guides/react/features/tanstack-router). +This SDK is currently in **ALPHA**. Alpha features are still in progress, may have bugs and might include breaking changes. +Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns. +This SDK is for [TanStack Start (React)](https://tanstack.com/start/latest/docs/framework/react/overview), for +using [TanStack Router (React)](https://tanstack.com/router/latest/docs/framework/react/overview) see our React docs for +[TanStack Router](/platforms/javascript/guides/react/features/tanstack-router). - ## Step 1: Install @@ -21,7 +20,13 @@ description: "Learn how to set up and configure Sentry in your TanStack Start Re Choose the features you want to configure, and this guide will show you how: @@ -77,7 +82,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -114,7 +119,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -175,7 +180,9 @@ import * as Sentry from "@sentry/tanstackstart-react"; registerGlobalMiddleware({ middleware: [ - createMiddleware({ type: 'function' }).server(Sentry.sentryGlobalServerMiddlewareHandler()), + createMiddleware({ type: "function" }).server( + Sentry.sentryGlobalServerMiddlewareHandler() + ), ], }); ``` @@ -183,7 +190,9 @@ registerGlobalMiddleware({ ### Capture Errors in your Error Boundaries and Components - Automatic error monitoring is not yet supported on the on the server-side of TanStack Start. Use `captureException` to manually capture errors in your server-side code. + Automatic error monitoring is not yet supported on the on the server-side of + TanStack Start. Use `captureException` to manually capture errors in your + server-side code. The Sentry SDK cannot capture errors that you manually caught yourself with error boundaries. @@ -198,9 +207,12 @@ class MyErrorBoundary extends React.Component { // ... } -export const MySentryWrappedErrorBoundary = Sentry.withErrorBoundary(MyErrorBoundary, { - // ... sentry error wrapper options -}); +export const MySentryWrappedErrorBoundary = Sentry.withErrorBoundary( + MyErrorBoundary, + { + // ... sentry error wrapper options + } +); ``` If you defined `errorComponent`s in your Code-Based TanStack Router routes, capture the `error` argument with `captureException` inside a `useEffect` hook: diff --git a/docs/platforms/javascript/guides/vue/index.mdx b/docs/platforms/javascript/guides/vue/index.mdx index 6db1a53b1509c6..837feb3018a753 100644 --- a/docs/platforms/javascript/guides/vue/index.mdx +++ b/docs/platforms/javascript/guides/vue/index.mdx @@ -82,7 +82,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -142,7 +142,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance diff --git a/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx b/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx index 445e825cc1e24d..76e40c9f14fd59 100644 --- a/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx +++ b/platform-includes/getting-started-config/javascript.cloudflare.workers.mdx @@ -21,7 +21,7 @@ export default Sentry.withSentry( // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance diff --git a/platform-includes/getting-started-config/javascript.mdx b/platform-includes/getting-started-config/javascript.mdx index ccf847a38e13fa..5e4de083a78eb8 100644 --- a/platform-includes/getting-started-config/javascript.mdx +++ b/platform-includes/getting-started-config/javascript.mdx @@ -1,10 +1,10 @@ @@ -17,7 +17,7 @@ import * as Sentry from "@sentry/browser"; Sentry.init({ dsn: "___PUBLIC_DSN___", - + // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/configuration/options/#sendDefaultPii sendDefaultPii: true, @@ -42,7 +42,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -78,7 +78,7 @@ Sentry.init({ window.sentryOnLoad = function () { Sentry.init({ dsn: "___PUBLIC_DSN___", - + // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/configuration/options/#sendDefaultPii sendDefaultPii: true, @@ -103,7 +103,7 @@ Sentry.init({ // ___PRODUCT_OPTION_START___ logs // Enable logs to be sent to Sentry - _experiments: { enableLogs: true }, + enableLogs: true, // ___PRODUCT_OPTION_END___ logs // ___PRODUCT_OPTION_START___ performance @@ -122,7 +122,7 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error // Learn more at - // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // ___PRODUCT_OPTION_END___ session-replay @@ -141,7 +141,7 @@ Sentry.init({