@sentry/react-native 5.25.0 → 5.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -3
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +63 -2
- package/android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java +187 -0
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +10 -0
- package/dist/js/NativeRNSentry.d.ts +2 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/client.d.ts +4 -0
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +12 -2
- package/dist/js/client.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +9 -1
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/exports.d.ts +2 -1
- package/dist/js/integrations/exports.d.ts.map +1 -1
- package/dist/js/integrations/exports.js +2 -1
- package/dist/js/integrations/exports.js.map +1 -1
- package/dist/js/integrations/index.d.ts +1 -0
- package/dist/js/integrations/index.d.ts.map +1 -1
- package/dist/js/integrations/index.js +1 -0
- package/dist/js/integrations/index.js.map +1 -1
- package/dist/js/options.d.ts +24 -2
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts +47 -0
- package/dist/js/replay/mobilereplay.d.ts.map +1 -0
- package/dist/js/replay/mobilereplay.js +100 -0
- package/dist/js/replay/mobilereplay.js.map +1 -0
- package/dist/js/replay/networkUtils.d.ts +8 -0
- package/dist/js/replay/networkUtils.d.ts.map +1 -0
- package/dist/js/replay/networkUtils.js +52 -0
- package/dist/js/replay/networkUtils.js.map +1 -0
- package/dist/js/replay/xhrUtils.d.ts +6 -0
- package/dist/js/replay/xhrUtils.d.ts.map +1 -0
- package/dist/js/replay/xhrUtils.js +31 -0
- package/dist/js/replay/xhrUtils.js.map +1 -0
- package/dist/js/tools/enableLogger.d.ts +5 -0
- package/dist/js/tools/enableLogger.d.ts.map +1 -0
- package/dist/js/tools/enableLogger.js +13 -0
- package/dist/js/tools/enableLogger.js.map +1 -0
- package/dist/js/tools/metroconfig.d.ts +19 -4
- package/dist/js/tools/metroconfig.d.ts.map +1 -1
- package/dist/js/tools/metroconfig.js +38 -3
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformer.d.ts +4 -0
- package/dist/js/tools/sentryBabelTransformer.d.ts.map +1 -0
- package/dist/js/tools/sentryBabelTransformer.js +28 -0
- package/dist/js/tools/sentryBabelTransformer.js.map +1 -0
- package/dist/js/tools/sentryBabelTransformerUtils.d.ts +18 -0
- package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -0
- package/dist/js/tools/sentryBabelTransformerUtils.js +67 -0
- package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -0
- package/dist/js/tools/vendor/metro/metroBabelTransformer.d.ts +35 -0
- package/dist/js/tools/vendor/metro/metroBabelTransformer.d.ts.map +1 -0
- package/dist/js/tools/vendor/metro/metroBabelTransformer.js +3 -0
- package/dist/js/tools/vendor/metro/metroBabelTransformer.js.map +1 -0
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +57 -30
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/utils/clientutils.d.ts +10 -0
- package/dist/js/utils/clientutils.d.ts.map +1 -0
- package/dist/js/utils/clientutils.js +9 -0
- package/dist/js/utils/clientutils.js.map +1 -0
- package/dist/js/utils/environment.d.ts +4 -0
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +8 -0
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +6 -0
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +7 -1
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +24 -0
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +33 -1
- package/ios/RNSentryReplay.h +8 -0
- package/ios/RNSentryReplay.m +72 -0
- package/ios/RNSentryReplayBreadcrumbConverter.h +16 -0
- package/ios/RNSentryReplayBreadcrumbConverter.m +168 -0
- package/package.json +2 -1
- package/src/js/NativeRNSentry.ts +2 -0
- package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
- package/ts3.8/dist/js/client.d.ts +4 -0
- package/ts3.8/dist/js/integrations/exports.d.ts +2 -1
- package/ts3.8/dist/js/integrations/index.d.ts +1 -0
- package/ts3.8/dist/js/options.d.ts +24 -2
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +47 -0
- package/ts3.8/dist/js/replay/networkUtils.d.ts +8 -0
- package/ts3.8/dist/js/replay/xhrUtils.d.ts +6 -0
- package/ts3.8/dist/js/utils/clientutils.d.ts +10 -0
- package/ts3.8/dist/js/utils/environment.d.ts +4 -0
- package/ts3.8/dist/js/utils/worldwide.d.ts +6 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +7 -1
package/dist/js/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc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C,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n this._initNativeSdk();\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * Sets up the integrations\n */\n protected _setupIntegrations(): void {\n super._setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing = tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk(this._options)\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc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AAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Sets up the integrations\n */\n protected _setupIntegrations(): void {\n super._setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing = tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._isEnabled() && this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/ for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAgC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAuFvF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNativeTracing } from '../tracing';
|
|
2
2
|
import { isExpoGo, notWeb } from '../utils/environment';
|
|
3
|
-
import { breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, viewHierarchyIntegration, } from './exports';
|
|
3
|
+
import { breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, browserReplayIntegration, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, viewHierarchyIntegration, } from './exports';
|
|
4
4
|
import { createReactNativeRewriteFrames } from './rewriteframes';
|
|
5
5
|
/**
|
|
6
6
|
* Returns the default ReactNative integrations based on the current environment.
|
|
@@ -70,6 +70,14 @@ export function getDefaultIntegrations(options) {
|
|
|
70
70
|
sidecarUrl: options.spotlightSidecarUrl,
|
|
71
71
|
}));
|
|
72
72
|
}
|
|
73
|
+
if ((options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
|
|
74
|
+
(options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')) {
|
|
75
|
+
integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());
|
|
76
|
+
if (!notWeb()) {
|
|
77
|
+
options.replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;
|
|
78
|
+
options.replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
73
81
|
return integrations;
|
|
74
82
|
}
|
|
75
83
|
//# sourceMappingURL=default.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB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AAsB,EAAE,CAAC,CAAC;KAC7C;IAED,IAAI,OAAO,CAAC,eAAe,EAAE;QAC3B,YAAY,CAAC,IAAI,CACf,oBAAoB,CAAC;YACnB,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC,CAAC,CACH,CAAC;KACH;IAED,IACE,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,EAC3F;QACA,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,MAAM,EAAE,EAAE;YACZ,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;YACpG,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;SACtG;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { BrowserOptions } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n browserReplayIntegration,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n viewHierarchyIntegration,\n} from './exports';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.enableSpotlight) {\n integrations.push(\n spotlightIntegration({\n sidecarUrl: options.spotlightSidecarUrl,\n }),\n );\n }\n\n if (\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')\n ) {\n integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());\n if (!notWeb()) {\n (options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n (options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n }\n\n return integrations;\n}\n"]}
|
|
@@ -12,5 +12,6 @@ export { screenshotIntegration } from './screenshot';
|
|
|
12
12
|
export { viewHierarchyIntegration } from './viewhierarchy';
|
|
13
13
|
export { expoContextIntegration } from './expocontext';
|
|
14
14
|
export { spotlightIntegration } from './spotlight';
|
|
15
|
-
export {
|
|
15
|
+
export { mobileReplayIntegration } from '../replay/mobilereplay';
|
|
16
|
+
export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, replayIntegration as browserReplayIntegration, } from '@sentry/react';
|
|
16
17
|
//# sourceMappingURL=exports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4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AAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,EACxB,iBAAiB,IAAI,wBAAwB,GAC9C,MAAM,eAAe,CAAC"}
|
|
@@ -12,5 +12,6 @@ export { screenshotIntegration } from './screenshot';
|
|
|
12
12
|
export { viewHierarchyIntegration } from './viewhierarchy';
|
|
13
13
|
export { expoContextIntegration } from './expocontext';
|
|
14
14
|
export { spotlightIntegration } from './spotlight';
|
|
15
|
-
export {
|
|
15
|
+
export { mobileReplayIntegration } from '../replay/mobilereplay';
|
|
16
|
+
export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, replayIntegration as browserReplayIntegration, } from '@sentry/react';
|
|
16
17
|
//# sourceMappingURL=exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EA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AE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,EACxB,iBAAiB,IAAI,wBAAwB,GAC9C,MAAM,eAAe,CAAC","sourcesContent":["export { debugSymbolicatorIntegration } from './debugsymbolicator';\nexport { deviceContextIntegration } from './devicecontext';\nexport { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';\nexport { nativeLinkedErrorsIntegration } from './nativelinkederrors';\nexport { nativeReleaseIntegration } from './release';\nexport { eventOriginIntegration } from './eventorigin';\nexport { sdkInfoIntegration } from './sdkinfo';\nexport { reactNativeInfoIntegration } from './reactnativeinfo';\nexport { modulesLoaderIntegration } from './modulesloader';\nexport { hermesProfilingIntegration } from '../profiling/integration';\nexport { screenshotIntegration } from './screenshot';\nexport { viewHierarchyIntegration } from './viewhierarchy';\nexport { expoContextIntegration } from './expocontext';\nexport { spotlightIntegration } from './spotlight';\nexport { mobileReplayIntegration } from '../replay/mobilereplay';\n\nexport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n globalHandlersIntegration as browserGlobalHandlersIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n linkedErrorsIntegration as browserLinkedErrorsIntegration,\n rewriteFramesIntegration,\n replayIntegration as browserReplayIntegration,\n} from '@sentry/react';\n"]}
|
|
@@ -12,4 +12,5 @@ export { Screenshot } from './screenshot';
|
|
|
12
12
|
export { ViewHierarchy } from './viewhierarchy';
|
|
13
13
|
export { ExpoContext } from './expocontext';
|
|
14
14
|
export { Spotlight } from './spotlight';
|
|
15
|
+
export { mobileReplayIntegration } from '../replay/mobilereplay';
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -13,4 +13,5 @@ export { Screenshot } from './screenshot';
|
|
|
13
13
|
export { ViewHierarchy } from './viewhierarchy';
|
|
14
14
|
export { ExpoContext } from './expocontext';
|
|
15
15
|
export { Spotlight } from './spotlight';
|
|
16
|
+
export { mobileReplayIntegration } from '../replay/mobilereplay';
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// THESE EXPORTS WILL BE REMOVED IN THE NEXT MAJOR RELEASE\n\nexport { DebugSymbolicator } from './debugsymbolicator';\nexport { DeviceContext } from './devicecontext';\nexport { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';\nexport { NativeLinkedErrors } from './nativelinkederrors';\nexport { Release } from './release';\nexport { EventOrigin } from './eventorigin';\nexport { SdkInfo } from './sdkinfo';\nexport { ReactNativeInfo } from './reactnativeinfo';\nexport { ModulesLoader } from './modulesloader';\nexport { HermesProfiling } from '../profiling/integration';\nexport { Screenshot } from './screenshot';\nexport { ViewHierarchy } from './viewhierarchy';\nexport { ExpoContext } from './expocontext';\nexport { Spotlight } from './spotlight';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["// THESE EXPORTS WILL BE REMOVED IN THE NEXT MAJOR RELEASE\n\nexport { DebugSymbolicator } from './debugsymbolicator';\nexport { DeviceContext } from './devicecontext';\nexport { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';\nexport { NativeLinkedErrors } from './nativelinkederrors';\nexport { Release } from './release';\nexport { EventOrigin } from './eventorigin';\nexport { SdkInfo } from './sdkinfo';\nexport { ReactNativeInfo } from './reactnativeinfo';\nexport { ModulesLoader } from './modulesloader';\nexport { HermesProfiling } from '../profiling/integration';\nexport { Screenshot } from './screenshot';\nexport { ViewHierarchy } from './viewhierarchy';\nexport { ExpoContext } from './expocontext';\nexport { Spotlight } from './spotlight';\nexport { mobileReplayIntegration } from '../replay/mobilereplay';\n"]}
|
package/dist/js/options.d.ts
CHANGED
|
@@ -159,6 +159,28 @@ export interface BaseReactNativeOptions {
|
|
|
159
159
|
* from the function, no screenshot will be attached.
|
|
160
160
|
*/
|
|
161
161
|
beforeScreenshot?: (event: Event, hint: EventHint) => boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
164
|
+
*/
|
|
165
|
+
_experiments?: {
|
|
166
|
+
[key: string]: unknown;
|
|
167
|
+
/**
|
|
168
|
+
* The sample rate for profiling
|
|
169
|
+
* 1.0 will profile all transactions and 0 will profile none.
|
|
170
|
+
*/
|
|
171
|
+
profilesSampleRate?: number;
|
|
172
|
+
/**
|
|
173
|
+
* The sample rate for session-long replays.
|
|
174
|
+
* 1.0 will record all sessions and 0 will record none.
|
|
175
|
+
*/
|
|
176
|
+
replaysSessionSampleRate?: number;
|
|
177
|
+
/**
|
|
178
|
+
* The sample rate for sessions that has had an error occur.
|
|
179
|
+
* This is independent of `sessionSampleRate`.
|
|
180
|
+
* 1.0 will record all sessions and 0 will record none.
|
|
181
|
+
*/
|
|
182
|
+
replaysOnErrorSampleRate?: number;
|
|
183
|
+
};
|
|
162
184
|
}
|
|
163
185
|
export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
164
186
|
/**
|
|
@@ -170,9 +192,9 @@ export interface ReactNativeTransportOptions extends BrowserTransportOptions {
|
|
|
170
192
|
* Configuration options for the Sentry ReactNative SDK.
|
|
171
193
|
* @see ReactNativeFrontend for more information.
|
|
172
194
|
*/
|
|
173
|
-
export interface ReactNativeOptions extends Options<ReactNativeTransportOptions>, BaseReactNativeOptions {
|
|
195
|
+
export interface ReactNativeOptions extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>, BaseReactNativeOptions {
|
|
174
196
|
}
|
|
175
|
-
export interface ReactNativeClientOptions extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel'>, BaseReactNativeOptions {
|
|
197
|
+
export interface ReactNativeClientOptions extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>, BaseReactNativeOptions {
|
|
176
198
|
}
|
|
177
199
|
export interface ReactNativeWrapperOptions {
|
|
178
200
|
/** Props for the root React profiler */
|
package/dist/js/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF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QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;;WAGG;QACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAElC;;;;WAIG;QACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC,CAAC;CACH;AAED,MAAM,WAAW,2BAA4B,SAAQ,uBAAuB;IAC1E;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AAEH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,cAAc,CAAC,EAChE,sBAAsB;CAAG;AAE7B,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,aAAa,CAAC,2BAA2B,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC,EACjF,sBAAsB;CAAG;AAE7B,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAkBtE"}
|
package/dist/js/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA+OvD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport type { ProfilerProps } from '@sentry/react/types/profiler';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/types';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * This option will enable forwarding captured Sentry events to Spotlight.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n enableSpotlight?: boolean;\n\n /**\n * This option changes the default Spotlight Sidecar URL.\n *\n * By default, the SDK expects the Sidecar to be running\n * on the same host as React Native Metro Dev Server.\n *\n * More details: https://spotlightjs.com/\n *\n * @default \"http://localhost:8969/stream\"\n */\n spotlightSidecarUrl?: string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n };\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { IntegrationFnResult } from '@sentry/types';
|
|
2
|
+
export declare const MOBILE_REPLAY_INTEGRATION_NAME = "MobileReplay";
|
|
3
|
+
export interface MobileReplayOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Mask all text in recordings
|
|
6
|
+
*
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
maskAllText?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Mask all text in recordings
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
maskAllImages?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Mask all vector graphics in recordings
|
|
18
|
+
* Supports `react-native-svg`
|
|
19
|
+
*
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
maskAllVectors?: boolean;
|
|
23
|
+
}
|
|
24
|
+
type MobileReplayIntegration = IntegrationFnResult & {
|
|
25
|
+
options: Required<MobileReplayOptions>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The Mobile Replay Integration, let's you adjust the default mobile replay options.
|
|
29
|
+
* To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
|
|
30
|
+
*
|
|
31
|
+
* ```javascript
|
|
32
|
+
* Sentry.init({
|
|
33
|
+
* _experiments: {
|
|
34
|
+
* replaysOnErrorSampleRate: 1.0,
|
|
35
|
+
* replaysSessionSampleRate: 1.0,
|
|
36
|
+
* },
|
|
37
|
+
* integrations: [mobileReplayIntegration({
|
|
38
|
+
* // Adjust the default options
|
|
39
|
+
* })],
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @experimental
|
|
44
|
+
*/
|
|
45
|
+
export declare const mobileReplayIntegration: (initOptions?: MobileReplayOptions) => MobileReplayIntegration;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=mobilereplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAShG,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAQD,KAAK,uBAAuB,GAAG,mBAAmB,GAAG;IACnD,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,mBAAmB,KAAoB,uBAuE3F,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { logger } from '@sentry/utils';
|
|
3
|
+
import { isHardCrash } from '../misc';
|
|
4
|
+
import { hasHooks } from '../utils/clientutils';
|
|
5
|
+
import { isExpoGo, notMobileOs } from '../utils/environment';
|
|
6
|
+
import { NATIVE } from '../wrapper';
|
|
7
|
+
import { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';
|
|
8
|
+
export const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';
|
|
9
|
+
const defaultOptions = {
|
|
10
|
+
maskAllText: true,
|
|
11
|
+
maskAllImages: true,
|
|
12
|
+
maskAllVectors: true,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The Mobile Replay Integration, let's you adjust the default mobile replay options.
|
|
16
|
+
* To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
|
|
17
|
+
*
|
|
18
|
+
* ```javascript
|
|
19
|
+
* Sentry.init({
|
|
20
|
+
* _experiments: {
|
|
21
|
+
* replaysOnErrorSampleRate: 1.0,
|
|
22
|
+
* replaysSessionSampleRate: 1.0,
|
|
23
|
+
* },
|
|
24
|
+
* integrations: [mobileReplayIntegration({
|
|
25
|
+
* // Adjust the default options
|
|
26
|
+
* })],
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @experimental
|
|
31
|
+
*/
|
|
32
|
+
export const mobileReplayIntegration = (initOptions = defaultOptions) => {
|
|
33
|
+
if (isExpoGo()) {
|
|
34
|
+
logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \`expo prebuild\` to enable it.`);
|
|
35
|
+
}
|
|
36
|
+
if (notMobileOs()) {
|
|
37
|
+
logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);
|
|
38
|
+
}
|
|
39
|
+
if (isExpoGo() || notMobileOs()) {
|
|
40
|
+
return mobileReplayIntegrationNoop();
|
|
41
|
+
}
|
|
42
|
+
const options = Object.assign(Object.assign({}, defaultOptions), initOptions);
|
|
43
|
+
function processEvent(event) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const hasException = event.exception && event.exception.values && event.exception.values.length > 0;
|
|
46
|
+
if (!hasException) {
|
|
47
|
+
// Event is not an error, will not capture replay
|
|
48
|
+
return event;
|
|
49
|
+
}
|
|
50
|
+
const recordingReplayId = NATIVE.getCurrentReplayId();
|
|
51
|
+
if (recordingReplayId) {
|
|
52
|
+
logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`);
|
|
53
|
+
return event;
|
|
54
|
+
}
|
|
55
|
+
const replayId = yield NATIVE.captureReplay(isHardCrash(event));
|
|
56
|
+
if (!replayId) {
|
|
57
|
+
logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);
|
|
58
|
+
return event;
|
|
59
|
+
}
|
|
60
|
+
return event;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function setup(client) {
|
|
64
|
+
if (!hasHooks(client)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
client.on('createDsc', (dsc) => {
|
|
68
|
+
if (dsc.replay_id) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// TODO: For better performance, we should emit replayId changes on native, and hold the replayId value in JS
|
|
72
|
+
const currentReplayId = NATIVE.getCurrentReplayId();
|
|
73
|
+
if (currentReplayId) {
|
|
74
|
+
dsc.replay_id = currentReplayId;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);
|
|
78
|
+
}
|
|
79
|
+
// TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably
|
|
80
|
+
// https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45
|
|
81
|
+
return {
|
|
82
|
+
name: MOBILE_REPLAY_INTEGRATION_NAME,
|
|
83
|
+
setupOnce() {
|
|
84
|
+
/* Noop */
|
|
85
|
+
},
|
|
86
|
+
setup,
|
|
87
|
+
processEvent,
|
|
88
|
+
options: options,
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
const mobileReplayIntegrationNoop = () => {
|
|
92
|
+
return {
|
|
93
|
+
name: MOBILE_REPLAY_INTEGRATION_NAME,
|
|
94
|
+
setupOnce() {
|
|
95
|
+
/* Noop */
|
|
96
|
+
},
|
|
97
|
+
options: defaultOptions,
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=mobilereplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobilereplay.js","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,CAAC,MAAM,8BAA8B,GAAG,cAAc,CAAC;AA0B7D,MAAM,cAAc,GAAkC;IACpD,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;CACrB,CAAC;AAMF;;;;;;;;;;;;;;;;;GAiBG;AACH,M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C,EAAE;YACrB,OAAO;SACR;QAED,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,GAA2B,EAAE,EAAE;YACrD,IAAI,GAAG,CAAC,SAAS,EAAE;gBACjB,OAAO;aACR;YAED,6GAA6G;YAC7G,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;YACpD,IAAI,eAAe,EAAE;gBACnB,GAAG,CAAC,SAAS,GAAG,eAAe,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,CAAC;IACxE,CAAC;IAED,iHAAiH;IACjH,8GAA8G;IAC9G,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,KAAK;QACL,YAAY;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAA4B,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Client, DynamicSamplingContext, Event, IntegrationFnResult } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllText?: boolean;\n\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllImages?: boolean;\n\n /**\n * Mask all vector graphics in recordings\n * Supports `react-native-svg`\n *\n * @default true\n */\n maskAllVectors?: boolean;\n}\n\nconst defaultOptions: Required<MobileReplayOptions> = {\n maskAllText: true,\n maskAllImages: true,\n maskAllVectors: true,\n};\n\ntype MobileReplayIntegration = IntegrationFnResult & {\n options: Required<MobileReplayOptions>;\n};\n\n/**\n * The Mobile Replay Integration, let's you adjust the default mobile replay options.\n * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.\n *\n * ```javascript\n * Sentry.init({\n * _experiments: {\n * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\n * },\n * integrations: [mobileReplayIntegration({\n * // Adjust the default options\n * })],\n * });\n * ```\n *\n * @experimental\n */\nexport const mobileReplayIntegration = (initOptions: MobileReplayOptions = defaultOptions): MobileReplayIntegration => {\n if (isExpoGo()) {\n logger.warn(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \\`expo prebuild\\` to enable it.`,\n );\n }\n if (notMobileOs()) {\n logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);\n }\n\n if (isExpoGo() || notMobileOs()) {\n return mobileReplayIntegrationNoop();\n }\n\n const options = { ...defaultOptions, ...initOptions };\n\n async function processEvent(event: Event): Promise<Event> {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n // Event is not an error, will not capture replay\n return event;\n }\n\n const recordingReplayId = NATIVE.getCurrentReplayId();\n if (recordingReplayId) {\n logger.debug(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`,\n );\n return event;\n }\n\n const replayId = await NATIVE.captureReplay(isHardCrash(event));\n if (!replayId) {\n logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);\n return event;\n }\n\n return event;\n }\n\n function setup(client: Client): void {\n if (!hasHooks(client)) {\n return;\n }\n\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n if (dsc.replay_id) {\n return;\n }\n\n // TODO: For better performance, we should emit replayId changes on native, and hold the replayId value in JS\n const currentReplayId = NATIVE.getCurrentReplayId();\n if (currentReplayId) {\n dsc.replay_id = currentReplayId;\n }\n });\n\n client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);\n }\n\n // TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably\n // https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n setup,\n processEvent,\n options: options,\n };\n};\n\nconst mobileReplayIntegrationNoop = (): MobileReplayIntegration => {\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n options: defaultOptions,\n };\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react-native" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
/** Convert a Content-Length header to number/undefined. */
|
|
4
|
+
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
|
|
5
|
+
export type RequestBody = null | Blob | FormData | URLSearchParams | string | ArrayBuffer | undefined;
|
|
6
|
+
/** Get the size of a body. */
|
|
7
|
+
export declare function getBodySize(body: RequestBody): number | undefined;
|
|
8
|
+
//# sourceMappingURL=networkUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/networkUtils.ts"],"names":[],"mappings":";;AAGA,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAEtG,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAiCjE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RN_GLOBAL_OBJ } from '../utils/worldwide';
|
|
2
|
+
import { utf8ToBytes } from '../vendor';
|
|
3
|
+
/** Convert a Content-Length header to number/undefined. */
|
|
4
|
+
export function parseContentLengthHeader(header) {
|
|
5
|
+
if (!header) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
const size = parseInt(header, 10);
|
|
9
|
+
return isNaN(size) ? undefined : size;
|
|
10
|
+
}
|
|
11
|
+
/** Get the size of a body. */
|
|
12
|
+
export function getBodySize(body) {
|
|
13
|
+
if (!body) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
if (typeof body === 'string') {
|
|
18
|
+
return _encode(body).length;
|
|
19
|
+
}
|
|
20
|
+
if (body instanceof URLSearchParams) {
|
|
21
|
+
return _encode(body.toString()).length;
|
|
22
|
+
}
|
|
23
|
+
if (body instanceof FormData) {
|
|
24
|
+
const formDataStr = _serializeFormData(body);
|
|
25
|
+
return _encode(formDataStr).length;
|
|
26
|
+
}
|
|
27
|
+
if (body instanceof Blob) {
|
|
28
|
+
return body.size;
|
|
29
|
+
}
|
|
30
|
+
if (body instanceof ArrayBuffer) {
|
|
31
|
+
return body.byteLength;
|
|
32
|
+
}
|
|
33
|
+
// Currently unhandled types: ArrayBufferView, ReadableStream
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
// just return undefined
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
function _encode(input) {
|
|
41
|
+
if (RN_GLOBAL_OBJ.TextEncoder) {
|
|
42
|
+
return new RN_GLOBAL_OBJ.TextEncoder().encode(input);
|
|
43
|
+
}
|
|
44
|
+
return utf8ToBytes(input);
|
|
45
|
+
}
|
|
46
|
+
function _serializeFormData(formData) {
|
|
47
|
+
// This is a bit simplified, but gives us a decent estimate
|
|
48
|
+
// This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'
|
|
49
|
+
// @ts-expect-error passing FormData to URLSearchParams won't correctly serialize `File` entries, which is fine for this use-case. See https://github.com/microsoft/TypeScript/issues/30584
|
|
50
|
+
return new URLSearchParams(formData).toString();
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=networkUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkUtils.js","sourceRoot":"","sources":["../../../src/js/replay/networkUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,2DAA2D;AAC3D,MAAM,UAAU,wBAAwB,CAAC,MAAiC;IACxE,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC;AAID,8BAA8B;AAC9B,MAAM,UAAU,WAAW,CAAC,IAAiB;IAC3C,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,SAAS,CAAC;KAClB;IAED,IAAI;QACF,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;SAC7B;QAED,IAAI,IAAI,YAAY,eAAe,EAAE;YACnC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;SACxC;QAED,IAAI,IAAI,YAAY,QAAQ,EAAE;YAC5B,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAC7C,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;SACpC;QAED,IAAI,IAAI,YAAY,IAAI,EAAE;YACxB,OAAO,IAAI,CAAC,IAAI,CAAC;SAClB;QAED,IAAI,IAAI,YAAY,WAAW,EAAE;YAC/B,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;QAED,6DAA6D;KAC9D;IAAC,WAAM;QACN,wBAAwB;KACzB;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,IAAI,aAAa,CAAC,WAAW,EAAE;QAC7B,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KACtD;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAkB;IAC5C,2DAA2D;IAC3D,iFAAiF;IACjF,2LAA2L;IAC3L,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClD,CAAC","sourcesContent":["import { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { utf8ToBytes } from '../vendor';\n\n/** Convert a Content-Length header to number/undefined. */\nexport function parseContentLengthHeader(header: string | null | undefined): number | undefined {\n if (!header) {\n return undefined;\n }\n\n const size = parseInt(header, 10);\n return isNaN(size) ? undefined : size;\n}\n\nexport type RequestBody = null | Blob | FormData | URLSearchParams | string | ArrayBuffer | undefined;\n\n/** Get the size of a body. */\nexport function getBodySize(body: RequestBody): number | undefined {\n if (!body) {\n return undefined;\n }\n\n try {\n if (typeof body === 'string') {\n return _encode(body).length;\n }\n\n if (body instanceof URLSearchParams) {\n return _encode(body.toString()).length;\n }\n\n if (body instanceof FormData) {\n const formDataStr = _serializeFormData(body);\n return _encode(formDataStr).length;\n }\n\n if (body instanceof Blob) {\n return body.size;\n }\n\n if (body instanceof ArrayBuffer) {\n return body.byteLength;\n }\n\n // Currently unhandled types: ArrayBufferView, ReadableStream\n } catch {\n // just return undefined\n }\n\n return undefined;\n}\n\nfunction _encode(input: string): number[] | Uint8Array {\n if (RN_GLOBAL_OBJ.TextEncoder) {\n return new RN_GLOBAL_OBJ.TextEncoder().encode(input);\n }\n return utf8ToBytes(input);\n}\n\nfunction _serializeFormData(formData: FormData): string {\n // This is a bit simplified, but gives us a decent estimate\n // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n // @ts-expect-error passing FormData to URLSearchParams won't correctly serialize `File` entries, which is fine for this use-case. See https://github.com/microsoft/TypeScript/issues/30584\n return new URLSearchParams(formData).toString();\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Breadcrumb, BreadcrumbHint } from '@sentry/types';
|
|
2
|
+
/**
|
|
3
|
+
* Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
|
|
4
|
+
*/
|
|
5
|
+
export declare function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void;
|
|
6
|
+
//# sourceMappingURL=xhrUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkD,MAAM,eAAe,CAAC;AAMhH;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAyBlH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { dropUndefinedKeys } from '@sentry/utils';
|
|
2
|
+
import { getBodySize, parseContentLengthHeader } from './networkUtils';
|
|
3
|
+
/**
|
|
4
|
+
* Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
|
|
5
|
+
*/
|
|
6
|
+
export function enrichXhrBreadcrumbsForMobileReplay(breadcrumb, hint) {
|
|
7
|
+
if (breadcrumb.category !== 'xhr' || !hint) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const xhrHint = hint;
|
|
11
|
+
if (!xhrHint.xhr) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;
|
|
16
|
+
const reqSize = getBodySize(input);
|
|
17
|
+
const resSize = xhr.getResponseHeader('content-length')
|
|
18
|
+
? parseContentLengthHeader(xhr.getResponseHeader('content-length'))
|
|
19
|
+
: _getBodySize(xhr.response, xhr.responseType);
|
|
20
|
+
breadcrumb.data = dropUndefinedKeys(Object.assign({ start_timestamp: startTimestamp, end_timestamp: endTimestamp, request_body_size: reqSize, response_body_size: resSize }, breadcrumb.data));
|
|
21
|
+
}
|
|
22
|
+
function _getBodySize(body, responseType) {
|
|
23
|
+
try {
|
|
24
|
+
const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;
|
|
25
|
+
return getBodySize(bodyStr);
|
|
26
|
+
}
|
|
27
|
+
catch (_a) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=xhrUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xhrUtils.js","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;GAEG;AACH,MAAM,UAAU,mCAAmC,CAAC,UAAsB,EAAE,IAAgC;IAC1G,IAAI,UAAU,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,IAAI,EAAE;QAC1C,OAAO;KACR;IAED,MAAM,OAAO,GAAG,IAAwB,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;QAChB,OAAO;KACR;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,EAAE,cAAc,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAEzE,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;QACrD,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IAEjD,UAAU,CAAC,IAAI,GAAG,iBAAiB,iBACjC,eAAe,EAAE,cAAc,EAC/B,aAAa,EAAE,YAAY,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,kBAAkB,EAAE,OAAO,IACxB,UAAU,CAAC,IAAI,EAClB,CAAC;AACL,CAAC;AAOD,SAAS,YAAY,CACnB,IAAgC,EAChC,YAA4C;IAE5C,IAAI;QACF,MAAM,OAAO,GAAG,YAAY,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1G,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;KAC7B;IAAC,WAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC","sourcesContent":["import type { Breadcrumb, BreadcrumbHint, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport type { RequestBody } from './networkUtils';\nimport { getBodySize, parseContentLengthHeader } from './networkUtils';\n\n/**\n * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.\n */\nexport function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void {\n if (breadcrumb.category !== 'xhr' || !hint) {\n return;\n }\n\n const xhrHint = hint as Partial<XhrHint>;\n if (!xhrHint.xhr) {\n return;\n }\n\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;\n\n const reqSize = getBodySize(input);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType);\n\n breadcrumb.data = dropUndefinedKeys({\n start_timestamp: startTimestamp,\n end_timestamp: endTimestamp,\n request_body_size: reqSize,\n response_body_size: resSize,\n ...breadcrumb.data,\n });\n}\n\ntype XhrHint = XhrBreadcrumbHint & {\n xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;\n input?: RequestBody;\n};\n\nfunction _getBodySize(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n): number | undefined {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr);\n } catch {\n return undefined;\n }\n}\n"]}
|