Skip to content

Commit 95f9f4f

Browse files
authored
fix: more accurate type for serverConfig option (#484)
1 parent cc05555 commit 95f9f4f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/content/en/sentry/options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,11 @@ export default function () {
352352

353353
### serverConfig
354354

355-
- Type: `Object`
355+
- Type: `Object` or `String`
356356
- Default: `{}`
357357
- Sentry SDK [Basic Server Options](https://docs.sentry.io/platforms/node/configuration/options/).
358358
- The specified keys will override common options set in the `config` key.
359-
- The value can be a string in which case it needs to be a file path (can use [webpack aliases](https://nuxtjs.org/docs/2.x/directory-structure/assets#aliases)) pointing to a javascript file whose default export (a function) returns the configuration object. This is necessary in case some of the options rely on imported values or can't be serialized. The function can be `async`. Artificial example that switches out the `transport`:
359+
- The value can be a string in which case it needs to be a file path (can use [webpack aliases](https://nuxtjs.org/docs/2.x/directory-structure/assets#aliases)) pointing to a javascript file whose default export (a function) returns the configuration object. This is necessary in case some of the options rely on imported values or can't be serialized. The function can be `async`. An artificial example that switches out the `transport`:
360360
```js [~/config/sentry-server-config.js]
361361
import { makeNodeTransport } from '@sentry/node'
362362

types/sentry.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BrowserTracing } from '@sentry/tracing'
55
import { Options as SentryOptions } from '@sentry/types'
66
import { Options as SentryVueOptions, TracingOptions as SentryVueTracingOptions } from '@sentry/vue/types/types'
77
import { SentryCliPluginOptions } from '@sentry/webpack-plugin'
8-
import { Handlers } from '@sentry/node'
8+
import { NodeOptions, Handlers } from '@sentry/node'
99

1010
export interface SentryHandlerProxy {
1111
errorHandler: (error: any, req: IncomingMessage, res: ServerResponse, next: (error: any) => void) => void
@@ -47,7 +47,7 @@ export interface ModuleConfiguration {
4747
/** See available options at https://github.com/getsentry/sentry-webpack-plugin */
4848
publishRelease?: boolean | Partial<SentryCliPluginOptions>
4949
runtimeConfigKey?: string
50-
serverConfig?: SentryOptions | string
50+
serverConfig?: NodeOptions | string
5151
serverIntegrations?: IntegrationsConfiguration
5252
sourceMapStyle?: WebpackOptions.Devtool
5353
requestHandlerConfig?: Handlers.RequestHandlerOptions

0 commit comments

Comments
 (0)