diff --git a/platform-includes/getting-started-config/javascript.solidstart.mdx b/platform-includes/getting-started-config/javascript.solidstart.mdx index 4e3aae7407b3c..66368ab22d2a9 100644 --- a/platform-includes/getting-started-config/javascript.solidstart.mdx +++ b/platform-includes/getting-started-config/javascript.solidstart.mdx @@ -50,7 +50,9 @@ Sentry.init({ ### Instrumentation -Complete the setup by adding the Sentry middleware to your `src/middleware.ts` file. If you don't have a `src/middleware.ts` file yet, create one: +The Sentry SDK provides [middleware lifecycle](https://docs.solidjs.com/solid-start/advanced/middleware) handlers to enhance data collected by Sentry on the server side by enabling distributed tracing between the client and server. + +Complete the setup by adding `sentryBeforeResponseMiddleware` to your `src/middleware.ts` file. If you don't have a `src/middleware.ts` file yet, create one: ```typescript {filename:src/middleware.ts} import { sentryBeforeResponseMiddleware } from '@sentry/solidstart/middleware'; @@ -75,9 +77,7 @@ export default defineConfig({ }); ``` -The Sentry middleware enhances the data collected by Sentry on the server side by enabling distributed tracing between the client and server. - -If you previously added the `solidRouterBrowserTracingIntegration` integration in `src/entry-client.tsx`, wrap your Solid Router with `withSentryRouterRouting`. +If you previously added the `solidRouterBrowserTracingIntegration` integration to `Sentry.init` in `src/entry-client.tsx`, wrap your Solid Router with `withSentryRouterRouting`. This creates a higher order component, which will enable Sentry to collect navigation spans. ```tsx {filename:app.tsx} @@ -98,16 +98,13 @@ export default function App() { ### Run your application -Add an `--import` flag to the `NODE_OPTIONS` environment variable wherever you run your application. +Add an `--import` flag to the `NODE_OPTIONS` environment variable wherever you run your application to import `public/instrument.server.mjs`. -```bash {tabTitle: npm} -NODE_OPTIONS='--import=./public/instrument.server.mjs npm start -``` +For example, update your scripts in `package.json`. -```bash {tabTitle: yarn} -NODE_OPTIONS='--import=./public/instrument.server.mjs yarn start -``` - -```bash {tabTitle: pnpm} -NODE_OPTIONS='--import=./public/instrument.server.mjs pnpm start -``` +```json {filename:package.json} +{ + "scripts": { + "start": "NODE_OPTIONS='--import ./public/instrument.server.mjs' vinxi start", + } +}