Skip to content

Commit

Permalink
fix: more accurate type for serverConfig option (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Jan 3, 2023
1 parent cc05555 commit 95f9f4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/content/en/sentry/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ export default function () {

### serverConfig

- Type: `Object`
- Type: `Object` or `String`
- Default: `{}`
- Sentry SDK [Basic Server Options](https://docs.sentry.io/platforms/node/configuration/options/).
- The specified keys will override common options set in the `config` key.
- 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`:
- 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`:
```js [~/config/sentry-server-config.js]
import { makeNodeTransport } from '@sentry/node'
Expand Down
4 changes: 2 additions & 2 deletions types/sentry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BrowserTracing } from '@sentry/tracing'
import { Options as SentryOptions } from '@sentry/types'
import { Options as SentryVueOptions, TracingOptions as SentryVueTracingOptions } from '@sentry/vue/types/types'
import { SentryCliPluginOptions } from '@sentry/webpack-plugin'
import { Handlers } from '@sentry/node'
import { NodeOptions, Handlers } from '@sentry/node'

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

0 comments on commit 95f9f4f

Please sign in to comment.