diff --git a/package.json b/package.json index 8b5e20c78..a35aef3b5 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "@rrweb/record": "2.0.0-alpha.17", "@rrweb/rrweb-plugin-console-record": "2.0.0-alpha.17", "@rrweb/types": "2.0.0-alpha.17", - "@sentry/types": "8.7.0", "@testing-library/dom": "^9.3.0", "@testing-library/jest-dom": "^6.5.0", "@testing-library/preact": "^3.2.4", diff --git a/react/package.json b/react/package.json index 5c2d90420..3daebebd7 100644 --- a/react/package.json +++ b/react/package.json @@ -65,8 +65,5 @@ "setupFilesAfterEnv": [ "given2/setup" ] - }, - "dependencies": { - "@sentry/types": "7.37.2" } } diff --git a/src/extensions/sentry-integration.ts b/src/extensions/sentry-integration.ts index 940655dd0..2e14db7d1 100644 --- a/src/extensions/sentry-integration.ts +++ b/src/extensions/sentry-integration.ts @@ -14,6 +14,7 @@ * @param {string} [organization] Optional: The Sentry organization, used to send a direct link from PostHog to Sentry * @param {Number} [projectId] Optional: The Sentry project id, used to send a direct link from PostHog to Sentry * @param {string} [prefix] Optional: Url of a self-hosted sentry instance (default: https://sentry.io/organizations/) + * @param {SeverityLevel[] | '*'} [severityAllowList] Optional: send events matching the provided levels. Use '*' to send all events (default: ['error']) */ import { PostHog } from '../posthog-core' @@ -38,14 +39,14 @@ type _SentryException = any type _SentryEventProcessor = any type _SentryHub = any -interface _SentryIntegrationClass { +interface _SentryIntegration { name: string - setupOnce(addGlobalEventProcessor: (callback: _SentryEventProcessor) => void, getCurrentHub: () => _SentryHub): void + processEvent(event: _SentryEvent): _SentryEvent } -interface _SentryIntegration { +interface _SentryIntegrationClass { name: string - processEvent(event: _SentryEvent): _SentryEvent + setupOnce(addGlobalEventProcessor: (callback: _SentryEventProcessor) => void, getCurrentHub: () => _SentryHub): void } interface SentryExceptionProperties { @@ -61,13 +62,6 @@ export type SentryIntegrationOptions = { organization?: string projectId?: number prefix?: string - /** - * By default, only errors are sent to PostHog. You can set this to '*' to send all events. - * Or to an error of SeverityLevel to only send events matching the provided levels. - * e.g. ['error', 'fatal'] to send only errors and fatals - * e.g. ['error'] to send only errors -- the default when omitted - * e.g. '*' to send all events - */ severityAllowList?: SeverityLevel[] | '*' } @@ -107,7 +101,6 @@ export function createEventProcessor( $exception_list: any $exception_personURL: string $exception_level: SeverityLevel - $level: SeverityLevel } = { // PostHog Exception Properties, $exception_message: exceptions[0]?.value || event.message, @@ -121,7 +114,6 @@ export function createEventProcessor( $sentry_exception_message: exceptions[0]?.value || event.message, $sentry_exception_type: exceptions[0]?.type, $sentry_tags: event.tags, - $level: event.level, } if (organization && projectId) { @@ -164,13 +156,6 @@ export class SentryIntegration implements _SentryIntegrationClass { organization?: string, projectId?: number, prefix?: string, - /** - * By default, only errors are sent to PostHog. You can set this to '*' to send all events. - * Or to an error of SeverityLevel to only send events matching the provided levels. - * e.g. ['error', 'fatal'] to send only errors and fatals - * e.g. ['error'] to send only errors -- the default when omitted - * e.g. '*' to send all events - */ severityAllowList?: SeverityLevel[] | '*' ) { // setupOnce gets called by Sentry when it intializes the plugin