Default Integrations

All of Sentry’s SDKs provide integrations, which extend functionality of the SDK.

System integrations are enabled by default to integrate into the standard library or the interpreter itself. They are documented so you can be both aware of what they do and disable them if they cause issues.

Enabled by Default

InboundFilters

Import name: Sentry.Integrations.InboundFilters

This integration allows you to ignore specific errors based on the type, message, or URLs in a given exception.

It ignores errors that start with Script error or Javascript error: Script error by default.

To configure this integration, use ignoreErrorsdenyUrls, and allowUrls SDK options directly. Keep in mind that denyURL and allowURL work only for captured exceptions, not raw message events.

FunctionToString

Import name: Sentry.Integrations.FunctionToString

This integration allows the SDK to provide original functions and method names, even when our error or breadcrumbs handlers wrap them.

TryCatch

Import name: Sentry.Integrations.TryCatch

This integration wraps native time and events APIs (setTimeoutsetIntervalrequestAnimationFrameaddEventListener/removeEventListener) in try/catch blocks to handle async exceptions.

Import name: Sentry.Integrations.Breadcrumbs

This integration wraps native APIs to capture breadcrumbs. By default, the Sentry SDK wraps all APIs.

Available options:

Copied
{ beacon: boolean; // Log HTTP requests done with the Beacon API
  console: boolean; // Log calls to `console.log`, `console.debug`, etc
  dom: boolean; // Log all click and keypress events
  fetch: boolean; // Log HTTP requests done with the Fetch API
  history: boolean; // Log calls to `history.pushState` and friends
  sentry: boolean; // Log whenever we send an event to the server
  xhr: boolean; // Log HTTP requests done with the XHR API
}

GlobalHandlers

Import name: Sentry.Integrations.GlobalHandlers

This integration attaches global handlers to capture uncaught exceptions and unhandled rejections.

Available options:

Copied
{
  onerror: boolean;
  onunhandledrejection: boolean;
}

LinkedErrors

Import name: Sentry.Integrations.LinkedErrors

This integration allows you to configure linked errors. They’ll be recursively read up to a specified limit and lookup will be performed by a specific key. By default, the Sentry SDK sets the limit to five and the key used is cause.

Available options:

Copied
{
  key: string;
  limit: number;
}

UserAgent

Import name: Sentry.Integrations.UserAgent

This integration attaches user-agent information to the event, which allows us to correctly catalog and tag them with specific OS, browser, and version information.

Modifying System Integrations

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

To override their settings, provide a new instance with your config to integrations option. For example, to turn off browser capturing console calls: integrations: [new Sentry.Integrations.Breadcrumbs({ console: false })].

Removing an Integration

This example removes the default-enabled integration for adding breadcrumbs to the event:

Copied
import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: function(integrations) {
    // integrations will be all default integrations
    return integrations.filter(function(integration) {
      return integration.name !== "Breadcrumbs";
    });
  },
});
You can edit this page on GitHub.