Skip to content

Commit 5e1af7a

Browse files
committed
Document optional instrumentation file path option
1 parent 14a749a commit 5e1af7a

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

packages/solidstart/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ mount(() => <StartClient />, document.getElementById('app'));
6060

6161
### 3. Server-side Setup
6262

63-
Create an instrument file named `instrument.server.mjs` and add your initialization code for the server-side SDK.
63+
Create an instrument file named `src/instrument.server.ts` and add your initialization code for the server-side SDK.
6464

6565
```javascript
6666
import * as Sentry from '@sentry/solidstart';
@@ -125,6 +125,8 @@ export default defineConfig(withSentry({
125125
Sentry relies on running `instrument.server.ts` as early as possible. Add the `sentrySolidStartVite` plugin
126126
from `@sentry/solidstart` to your `app.config.ts`. This takes care of building `instrument.server.ts` and placing it alongside the server entry file.
127127

128+
If your `instrument.server.ts` file is not located in the `src` folder, you can specify the path via the `sentrySolidStartVite` plugin.
129+
128130
To upload source maps, configure an auth token. Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a
129131
`SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when
130132
building your project. We recommend you add the auth token to your CI/CD environment as an environment variable.
@@ -147,6 +149,8 @@ export default defineConfig(withSentry({
147149
project: process.env.SENTRY_PROJECT,
148150
authToken: process.env.SENTRY_AUTH_TOKEN,
149151
debug: true,
152+
// optional: if your `instrument.server.ts` file is not located inside `src`
153+
instrumentation: './mypath/instrument.server.ts'
150154
}),
151155
],
152156
},

packages/solidstart/src/config/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type Nitro = {
1313

1414
export type SolidStartInlineConfig = Parameters<typeof defineConfig>[0];
1515

16-
export type SolidStartInlineConfigNitroHooks = {
16+
export type SolidStartInlineServerConfig = {
1717
hooks?: {
1818
close?: () => unknown;
1919
'rollup:before'?: (nitro: Nitro) => unknown;

packages/solidstart/src/config/withSentry.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
Nitro,
77
SentrySolidStartConfigOptions,
88
SolidStartInlineConfig,
9-
SolidStartInlineConfigNitroHooks,
9+
SolidStartInlineServerConfig,
1010
} from './types';
1111

1212
/**
@@ -22,7 +22,7 @@ export const withSentry = (
2222
solidStartConfig: SolidStartInlineConfig = {},
2323
sentrySolidStartConfigOptions: SentrySolidStartConfigOptions = {},
2424
): SolidStartInlineConfig => {
25-
const server = (solidStartConfig.server || {}) as SolidStartInlineConfigNitroHooks;
25+
const server = (solidStartConfig.server || {}) as SolidStartInlineServerConfig;
2626
const hooks = server.hooks || {};
2727

2828
let serverDir: string;

packages/solidstart/src/vite/types.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ export type SentrySolidStartPluginOptions = {
127127
debug?: boolean;
128128

129129
/**
130-
* The path to your `instrumentation.server.ts|js` file.
131-
* e.g. './src/instrumentation.server.ts`
130+
* The path to your `instrument.server.ts|js` file.
131+
* e.g. `./src/instrument.server.ts`
132132
*
133-
* Defaults to: `./src/instrumentation.server.ts`
133+
* Defaults to: `./src/instrument.server.ts`
134134
*/
135135
instrumentation?: string;
136136
};

0 commit comments

Comments
 (0)