@@ -103,64 +103,32 @@ 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.
132-
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.
137-
138- Learn more about configuring the plugin in our
139- [ Sentry Vite Plugin documentation] ( https://www.npmjs.com/package/@sentry/vite-plugin ) .
110+ ` instrumentation ` option to ` withSentry ` .
140111
141112``` typescript
142- // app.config.ts
143113import { defineConfig } from ' @solidjs/start/config' ;
144- import { sentrySolidStartVite , withSentry } from ' @sentry/solidstart' ;
114+ import { withSentry } from ' @sentry/solidstart' ;
145115
146116export 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- ],
117+ withSentry (
118+ {
119+ // SolidStart config
120+ middleware: ' ./src/middleware.ts' ,
121+ },
122+ {
123+ // Sentry `withSentry` options
124+ org: process .env .SENTRY_ORG ,
125+ project: process .env .SENTRY_PROJECT ,
126+ authToken: process .env .SENTRY_AUTH_TOKEN ,
127+ debug: true ,
128+ // optional: if your `instrument.server.ts` file is not located inside `src`
129+ instrumentation: ' ./mypath/instrument.server.ts' ,
161130 },
162- // ...
163- }),
131+ ),
164132);
165133```
166134
@@ -188,28 +156,25 @@ For such platforms, we offer the `experimental_basicServerTracing` flag to add a
188156` instrument.server.mjs ` to the server entry file.
189157
190158``` typescript
191- // app.config.ts
192159import { defineConfig } from ' @solidjs/start/config' ;
193- import { sentrySolidStartVite , withSentry } from ' @sentry/solidstart' ;
160+ import { withSentry } from ' @sentry/solidstart' ;
194161
195162export default defineConfig (
196163 withSentry (
197164 {
198165 // ...
199166 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- // ...
211167 },
212- { experimental_basicServerTracing: true },
168+ {
169+ org: process .env .SENTRY_ORG ,
170+ project: process .env .SENTRY_PROJECT ,
171+ authToken: process .env .SENTRY_AUTH_TOKEN ,
172+ debug: true ,
173+ // optional: if your `instrument.server.ts` file is not located inside `src`
174+ instrumentation: ' ./mypath/instrument.server.ts' ,
175+ // optional: if NODE_OPTIONS or --import is not avaiable
176+ experimental_basicServerTracing: true ,
177+ },
213178 ),
214179);
215180```
0 commit comments