@@ -103,64 +103,39 @@ the client and server.
103103
104104### 5. Configure your application  
105105
106- For Sentry to work properly, SolidStart's ` app.config.ts `  has to be modified.
107- 
108- #### 5.1 Wrapping the config with ` withSentry `   
109- 
110- Add ` withSentry `  from ` @sentry/solidstart `  and wrap SolidStart's config inside ` app.config.ts ` .
111- 
112- ``` typescript 
113- import  { defineConfig  } from  ' @solidjs/start/config' 
114- import  { withSentry  } from  ' @sentry/solidstart' 
115- 
116- export  default  defineConfig (
117-   withSentry ({
118-     //  ...
119-     middleware: ' ./src/middleware.ts' 
120-   }),
121- );
122- ``` 
123- 
124- #### 5.2 Generate source maps and build ` instrument.server.ts `   
125- 
126- Sentry relies on running ` instrument.server.ts `  as early as possible. Add the ` sentrySolidStartVite `  plugin from
127- ` @sentry/solidstart `  to your ` app.config.ts ` . This takes care of building ` instrument.server.ts `  and placing it
128- alongside the server entry file.
106+ For Sentry to work properly, SolidStart's ` app.config.ts `  has to be modified. Wrap your config with ` withSentry `  and
107+ configure it to upload source maps.
129108
130109If your ` instrument.server.ts `  file is not located in the ` src `  folder, you can specify the path via the
131- ` sentrySolidStartVite `  plugin .
110+ ` instrumentation `  option to  ` withSentry ` .
132111
133- To upload source maps, configure an auth token. Auth tokens can be passed to the plugin explicitly with the ` authToken ` 
134- option, with a ` SENTRY_AUTH_TOKEN `  environment variable, or with an ` .env.sentry-build-plugin `  file in the working
135- directory when building your project. We recommend you add the auth token to your CI/CD environment as an environment
136- variable.
112+ To upload source maps, configure an auth token. Auth tokens can be passed explicitly with the ` authToken `  option, with a
113+ ` SENTRY_AUTH_TOKEN `  environment variable, or with an ` .env.sentry-build-plugin `  file in the working directory when
114+ building your project. We recommend adding the auth token to your CI/CD environment as an environment variable.
137115
138116Learn more about configuring the plugin in our
139117[ Sentry Vite Plugin documentation] ( https://www.npmjs.com/package/@sentry/vite-plugin ) .
140118
141119``` typescript 
142- //  app.config.ts
143120import  { defineConfig  } from  ' @solidjs/start/config' 
144- import  { sentrySolidStartVite ,  withSentry  } from  ' @sentry/solidstart' 
121+ import  { withSentry  } from  ' @sentry/solidstart' 
145122
146123export  default  defineConfig (
147-   withSentry ({
148-     //  ...
149-     middleware: ' ./src/middleware.ts' 
150-     vite: {
151-       plugins: [
152-         sentrySolidStartVite ({
153-           org: process .env .SENTRY_ORG ,
154-           project: process .env .SENTRY_PROJECT ,
155-           authToken: process .env .SENTRY_AUTH_TOKEN ,
156-           debug: true ,
157-           //  optional: if your `instrument.server.ts` file is not located inside `src`
158-           instrumentation: ' ./mypath/instrument.server.ts' 
159-         }),
160-       ],
124+   withSentry (
125+     {
126+       //  SolidStart config
127+       middleware: ' ./src/middleware.ts' 
128+     },
129+     {
130+       //  Sentry `withSentry` options
131+       org: process .env .SENTRY_ORG ,
132+       project: process .env .SENTRY_PROJECT ,
133+       authToken: process .env .SENTRY_AUTH_TOKEN ,
134+       debug: true ,
135+       //  optional: if your `instrument.server.ts` file is not located inside `src`
136+       instrumentation: ' ./mypath/instrument.server.ts' 
161137    },
162-     //  ...
163-   }),
138+   ),
164139);
165140``` 
166141
@@ -188,28 +163,25 @@ For such platforms, we offer the `experimental_basicServerTracing` flag to add a
188163` instrument.server.mjs `  to the server entry file.
189164
190165``` typescript 
191- //  app.config.ts
192166import  { defineConfig  } from  ' @solidjs/start/config' 
193- import  { sentrySolidStartVite ,  withSentry  } from  ' @sentry/solidstart' 
167+ import  { withSentry  } from  ' @sentry/solidstart' 
194168
195169export  default  defineConfig (
196170  withSentry (
197171    {
198172      //  ...
199173      middleware: ' ./src/middleware.ts' 
200-       vite: {
201-         plugins: [
202-           sentrySolidStartVite ({
203-             org: process .env .SENTRY_ORG ,
204-             project: process .env .SENTRY_PROJECT ,
205-             authToken: process .env .SENTRY_AUTH_TOKEN ,
206-             debug: true ,
207-           }),
208-         ],
209-       },
210-       //  ...
211174    },
212-     { experimental_basicServerTracing: true  },
175+     {
176+       org: process .env .SENTRY_ORG ,
177+       project: process .env .SENTRY_PROJECT ,
178+       authToken: process .env .SENTRY_AUTH_TOKEN ,
179+       debug: true ,
180+       //  optional: if your `instrument.server.ts` file is not located inside `src`
181+       instrumentation: ' ./mypath/instrument.server.ts' 
182+       //  optional: if NODE_OPTIONS or --import is not avaiable
183+       experimental_basicServerTracing: true ,
184+     },
213185  ),
214186);
215187``` 
0 commit comments