chore: updates types and readme
This commit is contained in:
@@ -48,6 +48,10 @@ export default config;
|
||||
|
||||
### Additional Options
|
||||
|
||||
- `enabled`: boolean | optional
|
||||
|
||||
Set to false to disable the plugin. Defaults to true.
|
||||
|
||||
- `init` : ClientOptions | optional
|
||||
|
||||
Sentry allows a variety of options to be passed into the Sentry.init() function, see the full list of options [here](https://docs.sentry.io/platforms/node/guides/express/configuration/options).
|
||||
|
||||
@@ -9,6 +9,7 @@ import type { PluginOptions } from './types'
|
||||
export const startSentry = (pluginOptions: PluginOptions): void => {
|
||||
const { dsn, options } = pluginOptions
|
||||
|
||||
if (dsn)
|
||||
try {
|
||||
const app = express()
|
||||
|
||||
@@ -23,7 +24,9 @@ export const startSentry = (pluginOptions: PluginOptions): void => {
|
||||
],
|
||||
})
|
||||
|
||||
app.use(Sentry.Handlers.requestHandler(options?.requestHandler || {}) as express.RequestHandler)
|
||||
app.use(
|
||||
Sentry.Handlers.requestHandler(options?.requestHandler || {}) as express.RequestHandler,
|
||||
)
|
||||
app.use(Sentry.Handlers.tracingHandler())
|
||||
|
||||
app.use(
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { RequestHandlerOptions } from '@sentry/node/types/handlers'
|
||||
import type { ClientOptions } from '@sentry/types'
|
||||
|
||||
export interface PluginOptions {
|
||||
dsn?: string
|
||||
dsn: string | null
|
||||
enabled?: boolean
|
||||
options?: {
|
||||
init?: Partial<ClientOptions>
|
||||
|
||||
Reference in New Issue
Block a user