ContextLines

Adds source code to your stack frames. (default)

Import name: Sentry.contextLinesIntegration

This integration is enabled by default. If you'd like to modify your default integrations, read this.

This integration adds source code to your stack frames. It ensures that you can see the code that caused the error directly in the Sentry UI.

Copied
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
  integrations: [Sentry.contextLinesIntegration()],
});

Type: number

The number of lines to collect around each stack frame's line number. Defaults to 7.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").