Skip to content

Commit 483e67e

Browse files
authored
docs(node): Add setup instructions for pluggable integrations (#6099)
Previously, the documentation page for Node.js's "Pluggable Integrations" used the wrong import names and did not explain that the user must install a separate package. This commit fixes both of these issues.
1 parent 6b36909 commit 483e67e

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

src/platforms/node/common/configuration/integrations/pluggable-integrations.mdx

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,37 @@ redirect_from:
66
description: "Learn about the different pluggable integrations and how to enable them."
77
---
88

9-
Pluggable integrations are integrations that can be additionally enabled to provide specific features. They're documented so you can understand what they do and enable them, if needed. To enable pluggable integrations, provide a new instance with your config to the `integrations` option. For example: `integrations: [new Sentry.Integrations.Modules()]`.
9+
Pluggable integrations are integrations that can be additionally enabled to provide specific features. They're documented so you can understand what they do and enable them, if needed.
10+
11+
## Install
12+
13+
To enable pluggable integrations, install the package `@sentry/integrations`.
14+
15+
```shell
16+
# Using yarn
17+
yarn add @sentry/integrations
18+
# Using npm
19+
npm install --save @sentry/integrations
20+
```
21+
22+
## Configure
23+
24+
After installation, you can import the integration and provide a new instance with your config to the `integrations` option.
25+
26+
```javascript
27+
import { CaptureConsole } from '@sentry/integrations';
28+
29+
Sentry.init({
30+
dsn: '___PUBLIC_DSN___',
31+
integrations: [new CaptureConsole()],
32+
});
33+
```
1034

1135
## Core
1236

1337
### CaptureConsole
1438

15-
_Import name: `Sentry.Integrations.CaptureConsole`_
39+
_Import name: `CaptureConsole`_
1640

1741
This integration captures all `Console API` calls and redirects them to Sentry using `captureMessage` call.
1842
It then re-triggers to preserve default native behavior.
@@ -27,13 +51,13 @@ Available options:
2751

2852
### Dedupe
2953

30-
_Import name: `Sentry.Integrations.Dedupe`_
54+
_Import name: `Dedupe`_
3155

3256
This integration deduplicates certain events. It can be helpful if you're receiving many duplicate errors. Be aware that we will only compare stack traces and fingerprints.
3357

3458
### Debug
3559

36-
_Import name: `Sentry.Integrations.Debug`_
60+
_Import name: `Debug`_
3761

3862
This integration allows you to inspect the contents of the processed event and `hint` object that will be passed to `beforeSend` or `beforeSendTransaction`. It will _always_ run as the last integration, no matter when it was registered.
3963

@@ -51,7 +75,7 @@ Available options:
5175

5276
### ExtraErrorData
5377

54-
_Import name: `Sentry.Integrations.ExtraErrorData`_
78+
_Import name: `ExtraErrorData`_
5579

5680
This integration extracts all non-native attributes from the `error` object and attaches them to the event as the `extra` data.
5781

@@ -68,7 +92,7 @@ Available options:
6892

6993
### RewriteFrames
7094

71-
_Import name: `Sentry.Integrations.RewriteFrames`_
95+
_Import name: `RewriteFrames`_
7296

7397
This integration allows you to apply a transformation to each frame of the stack trace. In the streamlined scenario, it can be used to change the name of the file frame it originates from, or it can be fed with an iterated function to apply any arbitrary transformation.
7498

@@ -81,6 +105,6 @@ For example, `C:\\Program Files\\Apache\\www` won't work, however, `/Program Fil
81105

82106
### Transaction
83107

84-
_Import name: `Sentry.Integrations.Transaction`_
108+
_Import name: `Transaction`_
85109

86110
This integration tries to extract useful transaction names that will be used to distinguish the event from the rest. It walks through all stack trace frames and reads the first in-app frame's module and function name.

0 commit comments

Comments
 (0)