# Integrations | Sentry for Hapi

The Sentry SDK uses integrations to hook into the functionality of popular libraries to automatically instrument your application and give you the best data out of the box.

Integrations automatically add error instrumentation, performance instrumentation, and/or extra context information to your application. Some are enabled by default, but you can disable them or modify their settings.

### [Integrations](https://docs.sentry.io/.md#integrations)

\| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | | --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | --- | | [`amqplibIntegration`](https://docs.sentry.io/amqplib.md) | ✓ | | ✓ | | | [`consoleIntegration`](https://docs.sentry.io/console.md) | ✓ | | | ✓ | | [`contextLinesIntegration`](https://docs.sentry.io/contextlines.md) | ✓ | ✓ | | | | [`dedupeIntegration`](https://docs.sentry.io/dedupe.md) | ✓ | ✓ | | | | [`functionToStringIntegration`](https://docs.sentry.io/functiontostring.md) | ✓ | | | | | [`genericPoolIntegration`](https://docs.sentry.io/genericpool.md) | ✓ | | ✓ | | | [`graphqlIntegration`](https://docs.sentry.io/graphql.md) | ✓ | | ✓ | | | [`hapiIntegration`](https://docs.sentry.io/hapi.md) | ✓ | | ✓ | | | [`httpIntegration`](https://docs.sentry.io/http.md) | ✓ | ✓ | ✓ | ✓ | | [`inboundFiltersIntegration`](https://docs.sentry.io/inboundfilters.md) | ✓ | ✓ | | | | [`kafkaIntegration`](https://docs.sentry.io/kafka.md) | ✓ | | ✓ | | | [`linkedErrorsIntegration`](https://docs.sentry.io/linkederrors.md) | ✓ | ✓ | | | | [`lruMemoizerIntegration`](https://docs.sentry.io/lrumemoizer.md) | ✓ | | ✓ | | | [`modulesIntegration`](https://docs.sentry.io/modules.md) | ✓ | | | ✓ | | [`mongoIntegration`](https://docs.sentry.io/mongo.md) | ✓ | | ✓ | | | [`mongooseIntegration`](https://docs.sentry.io/mongoose.md) | ✓ | | ✓ | | | [`mysqlIntegration`](https://docs.sentry.io/mysql.md) | ✓ | | ✓ | | | [`mysql2Integration`](https://docs.sentry.io/mysql2.md) | ✓ | | ✓ | | | [`nodeContextIntegration`](https://docs.sentry.io/nodecontext.md) | ✓ | | | ✓ | | [`nativeNodeFetchIntegration`](https://docs.sentry.io/nodefetch.md) | ✓ | | ✓ | ✓ | | [`onUncaughtExceptionIntegration`](https://docs.sentry.io/onuncaughtexception.md) | ✓ | ✓ | | | | [`onUnhandledRejectionIntegration`](https://docs.sentry.io/unhandledrejection.md) | ✓ | ✓ | | | | [`postgresIntegration`](https://docs.sentry.io/postgres.md) | ✓ | | ✓ | | | [`redisIntegration`](https://docs.sentry.io/redis.md) | ✓ | | ✓ | | | [`requestDataIntegration`](https://docs.sentry.io/requestdata.md) | ✓ | | ✓ | | | [`tediousIntegration`](https://docs.sentry.io/tedious.md) | ✓ | | ✓ | | | [`childProcessIntegration`](https://docs.sentry.io/childProcess.md) | ✓ | | | ✓ | | [`prismaIntegration`](https://docs.sentry.io/prisma.md) | ✓ | | ✓ | | | [`vercelAiIntegration`](https://docs.sentry.io/vercelai.md) | ✓ | | ✓ | | | [`anrIntegration`](https://docs.sentry.io/anr.md) | | ✓ | | | | [`captureConsoleIntegration`](https://docs.sentry.io/captureconsole.md) | | | | ✓ | | [`dataloaderIntegration`](https://docs.sentry.io/dataloader.md) | | | ✓ | | | [`extraErrorDataIntegration`](https://docs.sentry.io/extraerrordata.md) | | | | ✓ | | [`fsIntegration`](https://docs.sentry.io/fs.md) | | | ✓ | | | [`knexIntegration`](https://docs.sentry.io/knex.md) | | | ✓ | | | [`localVariablesIntegration`](https://docs.sentry.io/localvariables.md) | | ✓ | | | | [`nodeProfilingIntegration`](https://docs.sentry.io/nodeprofiling.md) | | | ✓ | | | [`rewriteFramesIntegration`](https://docs.sentry.io/rewriteframes.md) | | ✓ | | | | [`supabaseIntegration`](https://docs.sentry.io/supabase.md) | | ✓ | ✓ | | | | [`trpcMiddleware`](https://docs.sentry.io/trpc.md) | | ✓ | ✓ | ✓ |

## [Modifying Default Integrations](https://docs.sentry.io/.md#modifying-default-integrations)

To disable system integrations, set `defaultIntegrations: false` when calling `init()`.

To override their settings, provide a new instance with your config to the `integrations` option. For example, to turn off browser capturing console calls:

```javascript
Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",

  integrations: [
    Sentry.linkedErrorsIntegration({
      limit: 7,
    }),
  ],
});
```

## [Adding an Integration](https://docs.sentry.io/.md#adding-an-integration)

You can add additional integrations in your `init` call:

```javascript
import * as Sentry from "@sentry/node";

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

Sentry.addIntegration(Sentry.captureConsoleIntegration());
```

Alternatively, you can add integrations via `Sentry.addIntegration()`. This is useful if you only want to enable an integration in a specific environment or if you want to load an integration later. For all other cases, we recommend you use the `integrations` option.

```javascript
import * as Sentry from "@sentry/node";

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

## [Removing a Default Integration](https://docs.sentry.io/.md#removing-a-default-integration)

If you only want to remove a single or some of the default integrations, instead of disabling all of them with `defaultIntegrations: false`, you can use the following syntax to filter out the ones you don't want.

This example removes the integration for adding breadcrumbs to the event, which is enabled by default:

```javascript
Sentry.init({
  // ...
  integrations: function (integrations) {
    // integrations will be all default integrations
    return integrations.filter(function (integration) {
      return integration.name !== "Breadcrumbs";
    });
  },
});
```

## [Custom Integrations](https://docs.sentry.io/.md#custom-integrations)

You can also create [custom integrations](https://docs.sentry.io/custom.md).

## [Available Integrations](https://docs.sentry.io/.md#available-integrations)

* #### [Amqplib](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/amqplib.md)

  Adds instrumentation for Amqplib. (default)

* #### [Anr](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/anr.md)

  Capture events when the event loop is blocked and the application is no longer responding.

* #### [CaptureConsole](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/captureconsole.md)

  Captures all Console API calls via \`captureException\` or \`captureMessage\`.

* #### [Child Process Integration](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/childProcess.md)

  Adds instrumentation for child processes and worker threads (default)

* #### [Connect](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/connect.md)

  Adds performance instrumentation for Connect. (default)

* #### [Console](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/console.md)

  Capture console logs as breadcrumbs. (default)

* #### [Context](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/nodecontext.md)

  Capture context about the environment and the device that the client is running on, and add it to events. (default)

* #### [ContextLines](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/contextlines.md)

  Adds source code to your stack frames. (default)

* #### [Dataloader](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/dataloader.md)

  Adds instrumentation for Dataloader.

* #### [Dedupe](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/dedupe.md)

  Deduplicate certain events to avoid receiving duplicate errors. (default)

* #### [ExtraErrorData](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/extraerrordata.md)

  Extracts all non-native attributes from the error object and attaches them to the event as extra data.

* #### [FileSystem](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/fs.md)

  Adds instrumentation for filesystem operations.

* #### [FunctionToString](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/functiontostring.md)

  Allows the SDK to provide original functions and method names, even when those functions or methods are wrapped by our error or breadcrumb handlers. (default)

* #### [Generic Pool](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/genericpool.md)

  Adds instrumentation for Generic Pool. (default)

* #### [GraphQL](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/graphql.md)

  Adds instrumentation for GraphQL. (default)

* #### [Hapi](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/hapi.md)

  Adds performance instrumentation for Hapi. (default)

* #### [Http](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/http.md)

  Capture spans & breadcrumbs for http requests. (default)

* #### [InboundFilters](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/inboundfilters.md)

  Allows you to ignore specific errors based on the type, message, or URLs in a given exception. (default)

* #### [Kafka](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/kafka.md)

  Adds instrumentation for KafkaJS. (default)

* #### [Knex](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/knex.md)

  Adds instrumentation for Knex.

* #### [LinkedErrors](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/linkederrors.md)

  Allows you to configure linked errors. (default)

* #### [LocalVariables](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/localvariables.md)

  Add local variables to exception frames. (default)

* #### [LRU Memoizer](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/lrumemoizer.md)

  Adds instrumentation for LRU Memoizer. (default)

* #### [Modules](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/modules.md)

  Add node modules / packages to the event. (default)

* #### [MongoDB](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/mongo.md)

  Adds instrumentation for MongoDB. (default)

* #### [Mongoose](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/mongoose.md)

  Adds instrumentation for Mongoose. (default)

* #### [MySQL](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/mysql.md)

  Adds instrumentation for MySQL. (default)

* #### [MySQL2](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/mysql2.md)

  Adds instrumentation for MySQL2. (default)

* #### [NodeFetch](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/nodefetch.md)

  Capture spans & breadcrumbs for node fetch requests. (default)

* #### [NodeProfiling](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/nodeprofiling.md)

  Capture profiling data for Node.js applications.

* #### [OnUncaughtException](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/onuncaughtexception.md)

  Registers handlers to capture global uncaught exceptions. (default)

* #### [OnUnhandledRejection](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/unhandledrejection.md)

  Registers handlers to capture global unhandled promise rejections. (default)

* #### [Postgres](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/postgres.md)

  Adds instrumentation for Postgres. (default)

* #### [Prisma](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/prisma.md)

  Adds instrumentation for Prisma.

* #### [Redis](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/redis.md)

  Adds instrumentation for Redis. (default)

* #### [RequestData](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/requestdata.md)

  Adds data about an incoming request to an event. (default)

* #### [RewriteFrames](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/rewriteframes.md)

  Allows you to apply a transformation to each frame of the stack trace.

* #### [Supabase](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/supabase.md)

  Adds instrumentation for Supabase client operations.

* #### [Tedious](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/tedious.md)

  Adds instrumentation for Tedious. (default)

* #### [trpcMiddleware](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/trpc.md)

  Capture spans & errors for tRPC handlers.

* #### [Vercel AI](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/vercelai.md)

  Adds instrumentation for Vercel AI SDK.
