Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.18.6",
"@sentry/core": "10.73.0",
"@sentry/core": "11.0.0-alpha.2",
"@sentry/react-native": "8.24.0",
"@types/node": "^20.9.3",
"@types/react": "^19.1.4",
Expand Down
70 changes: 2 additions & 68 deletions packages/core/etc/sentry-react-native.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,50 @@
import { addConsoleInstrumentationFilter } from '@sentry/core';
import { addEventProcessor } from '@sentry/core';
import { addIntegration } from '@sentry/core';
import { AnthropicAiClient } from '@sentry/core';
import { AnthropicAiInstrumentedMethod } from '@sentry/core';
import { AnthropicAiOptions } from '@sentry/core';
import { AnthropicAiResponse } from '@sentry/core';
import { Breadcrumb } from '@sentry/core';
import { browserApiErrorsIntegration } from '@sentry/react';
import { globalHandlersIntegration as browserGlobalHandlersIntegration } from '@sentry/react';
import { linkedErrorsIntegration as browserLinkedErrorsIntegration } from '@sentry/react';
import type { BrowserOptions } from '@sentry/react';
import type { CaptureContext } from '@sentry/core';
import { captureEvent } from '@sentry/core';
import { captureException } from '@sentry/core';
import { captureFeedback } from '@sentry/core';
import { captureMessage } from '@sentry/core';
import { Client } from '@sentry/core';
import type { ClientOptions } from '@sentry/core';
import { CompiledGraph } from '@sentry/core';
import { consoleLoggingIntegration } from '@sentry/browser';
import { consoleSandbox } from '@sentry/core';
import { createLangChainCallbackHandler } from '@sentry/core';
import { createReduxEnhancer } from '@sentry/react';
import { dedupeIntegration } from '@sentry/react';
import type { Envelope } from '@sentry/core';
import { ErrorBoundary } from '@sentry/react';
import type { ErrorBoundaryProps } from '@sentry/react';
import { ErrorEvent } from '@sentry/core';
import { Event as Event_2 } from '@sentry/core';
import type { EventHint } from '@sentry/core';
import { Exception } from '@sentry/core';
import { extraErrorDataIntegration } from '@sentry/react';
import { FeatureFlagsIntegration } from '@sentry/browser';
import type { FeedbackFormData } from '@sentry/core';
import { functionToStringIntegration } from '@sentry/react';
import { getActiveSpan } from '@sentry/core';
import { getClient } from '@sentry/core';
import { getCurrentScope } from '@sentry/core';
import { getGlobalScope } from '@sentry/core';
import { getIsolationScope } from '@sentry/core';
import { getRootSpan } from '@sentry/core';
import { GoogleGenAIChat } from '@sentry/core';
import { GoogleGenAIClient } from '@sentry/core';
import { GoogleGenAIOptions } from '@sentry/core';
import type { HostComponent } from 'react-native';
import { httpClientIntegration } from '@sentry/react';
import { httpContextIntegration } from '@sentry/react';
import type { ImageStyle } from 'react-native';
import { inboundFiltersIntegration } from '@sentry/react';
import { instrumentAnthropicAiClient } from '@sentry/core';
import { InstrumentedMethod } from '@sentry/core';
import { instrumentGoogleGenAIClient } from '@sentry/core';
import { instrumentLangGraph } from '@sentry/core';
import { instrumentOpenAiClient } from '@sentry/core';
import { instrumentStateGraph } from '@sentry/core';
import { instrumentStateGraphCompile } from '@sentry/core';
import { eventFiltersIntegration as inboundFiltersIntegration } from '@sentry/react';
import { Integration } from '@sentry/core';
import { LangChainIntegration } from '@sentry/core';
import { LangChainOptions } from '@sentry/core';
import { LangGraphIntegration } from '@sentry/core';
import { LangGraphOptions } from '@sentry/core';
import { lastEventId } from '@sentry/core';
import { logger } from '@sentry/browser';
import type { makeFetchTransport } from '@sentry/browser';
import { Metric } from '@sentry/core';
import { metrics } from '@sentry/browser';

Check failure on line 54 in packages/core/etc/sentry-react-native.api.md

View check run for this annotation

@sentry/warden / warden: code-review

Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test

The v11 adaptation removes `instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`/`instrumentStateGraph*`, and related types from the `@sentry/react-native` entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains `8.24.0`. This is an unannounced public API break, and `packages/core/test/aiExports.test.ts` still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; `@sentry/server-utils` is server-only and is not a drop-in React Native replacement.
Comment on lines 11 to 54

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test

The v11 adaptation removes instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, createLangChainCallbackHandler, instrumentLangGraph/instrumentStateGraph*, and related types from the @sentry/react-native entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains 8.24.0. This is an unannounced public API break, and packages/core/test/aiExports.test.ts still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; @sentry/server-utils is server-only and is not a drop-in React Native replacement.

Evidence
  • packages/core/src/js/index.ts no longer re-exports the OpenAI, Anthropic, Google GenAI, LangChain, or LangGraph helpers, and states that they moved to server-only @sentry/server-utils.
  • The 8.x changelog explicitly documented these helpers as re-exports for use in React Native apps, establishing that they were part of the supported public surface.
  • packages/core/test/aiExports.test.ts still checks each helper and directly compares Sentry.instrumentLangGraph with Sentry.instrumentStateGraph, so the current entrypoint cannot satisfy the existing test.
  • packages/core/package.json remains at 8.24.0, and the current Unreleased changelog has no migration or breaking-change note for this removal.
Also found at 5 additional locations
  • packages/core/etc/sentry-react-native.api.md:418-423
  • packages/core/etc/sentry-react-native.api.md:490-495
  • packages/core/src/js/index.ts:50-62
  • packages/core/etc/sentry-react-native.api.md:104-109
  • packages/core/etc/sentry-react-native.api.md:149-161

Identified by Warden ยท code-review ยท TU5-K4F

import { OpenAiClient } from '@sentry/core';
import { OpenAiOptions } from '@sentry/core';
import type { Options } from '@sentry/core';
import { Profiler } from '@sentry/react';
import * as React_2 from 'react';
Expand Down Expand Up @@ -123,20 +101,12 @@
export { addConsoleInstrumentationFilter }

export { addEventProcessor }

export { addIntegration }

export { AnthropicAiClient }

export { AnthropicAiInstrumentedMethod }

export { AnthropicAiOptions }

export { AnthropicAiResponse }

// @public
export function appLoaded(): void;

Check failure on line 109 in packages/core/etc/sentry-react-native.api.md

View check run for this annotation

@sentry/warden / warden: code-review

[TU5-K4F] Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test (additional location)

The v11 adaptation removes `instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`/`instrumentStateGraph*`, and related types from the `@sentry/react-native` entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains `8.24.0`. This is an unannounced public API break, and `packages/core/test/aiExports.test.ts` still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; `@sentry/server-utils` is server-only and is not a drop-in React Native replacement.
// @public (undocumented)
export const appRegistryIntegration: () => Integration & {
onRunApplication: (callback: () => void) => void;
Expand Down Expand Up @@ -176,23 +146,19 @@

export { captureMessage }

// @public
export function close(): Promise<void>;

export { CompiledGraph }

export { consoleLoggingIntegration }

export { consoleSandbox }

// @public
export function crashedLastRun(): Promise<boolean | null>;

export { createLangChainCallbackHandler }

// @public (undocumented)
export const createNativeFramesIntegrations: (enable: boolean | undefined) => Integration | undefined;

Check failure on line 161 in packages/core/etc/sentry-react-native.api.md

View check run for this annotation

@sentry/warden / warden: code-review

[TU5-K4F] Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test (additional location)

The v11 adaptation removes `instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`/`instrumentStateGraph*`, and related types from the `@sentry/react-native` entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains `8.24.0`. This is an unannounced public API break, and `packages/core/test/aiExports.test.ts` still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; `@sentry/server-utils` is server-only and is not a drop-in React Native replacement.
// @public
export function createReactNativeRewriteFrames(): Integration;

Expand Down Expand Up @@ -430,12 +396,6 @@
includeUnhandledRejections?: boolean;
};

export { GoogleGenAIChat }

export { GoogleGenAIClient }

export { GoogleGenAIOptions }

// Warning: (ae-forgotten-export) The symbol "GraphQLReactNativeIntegrationOptions" needs to be exported by the entry point index.d.ts
//
// @public
Expand All @@ -455,34 +415,12 @@

export { inboundFiltersIntegration }

// @public
export function init(passedOptions: ReactNativeOptions): void;

export { instrumentAnthropicAiClient }

export { InstrumentedMethod }

export { instrumentGoogleGenAIClient }

export { instrumentLangGraph }

export { instrumentOpenAiClient }

export { instrumentStateGraph }

export { instrumentStateGraphCompile }

export { LangChainIntegration }

export { LangChainOptions }

export { LangGraphIntegration }

export { LangGraphOptions }

export { lastEventId }

// @public (undocumented)

Check failure on line 423 in packages/core/etc/sentry-react-native.api.md

View check run for this annotation

@sentry/warden / warden: code-review

[TU5-K4F] Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test (additional location)

The v11 adaptation removes `instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`/`instrumentStateGraph*`, and related types from the `@sentry/react-native` entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains `8.24.0`. This is an unannounced public API break, and `packages/core/test/aiExports.test.ts` still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; `@sentry/server-utils` is server-only and is not a drop-in React Native replacement.
export const logEnricherIntegration: () => Integration;

export { logger }
Expand Down Expand Up @@ -549,16 +487,12 @@
medium: FontStyle;
bold: FontStyle;
heavy: FontStyle;
};
}

export { OpenAiClient }

export { OpenAiOptions }

// @public
export function pauseAppHangTracking(): void;

Check failure on line 495 in packages/core/etc/sentry-react-native.api.md

View check run for this annotation

@sentry/warden / warden: code-review

[TU5-K4F] Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test (additional location)

The v11 adaptation removes `instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`/`instrumentStateGraph*`, and related types from the `@sentry/react-native` entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains `8.24.0`. This is an unannounced public API break, and `packages/core/test/aiExports.test.ts` still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; `@sentry/server-utils` is server-only and is not a drop-in React Native replacement.
// @public
export function popTurboModuleCall(callId: number): void;

Expand Down Expand Up @@ -949,7 +883,7 @@
// src/js/feedback/integration.ts:21:5 - (ae-forgotten-export) The symbol "ScreenshotButtonProps" needs to be exported by the entry point index.d.ts
// src/js/feedback/integration.ts:23:5 - (ae-forgotten-export) The symbol "FeedbackFormTheme" needs to be exported by the entry point index.d.ts
// src/js/tracing/reactnativetracing.ts:90:3 - (ae-forgotten-export) The symbol "ReactNativeTracingState" needs to be exported by the entry point index.d.ts
// src/js/tracing/reactnavigation.ts:228:3 - (ae-forgotten-export) The symbol "RouteOverrideProvider" needs to be exported by the entry point index.d.ts
// src/js/tracing/reactnavigation.ts:230:3 - (ae-forgotten-export) The symbol "RouteOverrideProvider" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
"react-native": ">=0.65.0"
},
"dependencies": {
"@sentry/browser": "10.73.0",
"@sentry/bundler-plugins": "10.73.0",
"@sentry/browser": "11.0.0-alpha.2",
"@sentry/bundler-plugins": "11.0.0-alpha.2",
"@sentry/cli": "3.7.0",
"@sentry/core": "10.73.0",
"@sentry/core": "11.0.0-alpha.2",
"@sentry/expo-upload-sourcemaps": "workspace:*",
"@sentry/react": "10.73.0"
"@sentry/react": "11.0.0-alpha.2"
},
"devDependencies": {
"@babel/core": "^7.26.7",
Expand All @@ -87,8 +87,8 @@
"@mswjs/interceptors": "^0.25.15",
"@react-native/babel-preset": "0.87.1",
"@react-native/jest-preset": "0.87.1",
"@sentry/eslint-plugin-sdk": "10.73.0",
"@sentry/typescript": "10.73.0",
"@sentry/eslint-plugin-sdk": "11.0.0-alpha.2",
"@sentry/typescript": "11.0.0-alpha.2",
"@sentry/wizard": "7.0.3",
"@testing-library/react-native": "^13.2.2",
"@types/jest": "^29.5.13",
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/js/feedback/FeedbackForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export class FeedbackForm extends React.Component<FeedbackFormProps, FeedbackFor
const currentUser = {
useSentryUser: {
email: this.props?.useSentryUser?.email || this._getUser()?.email || '',
name: this.props?.useSentryUser?.name || this._getUser()?.name || '',
// `User.name` was removed from the typed interface in JS v11 (it now
// only exists via the `[key: string]: unknown` index signature), so
// narrow it back to the string it holds.
name: this.props?.useSentryUser?.name || (this._getUser()?.name as string | undefined) || '',
},
};

Expand Down
30 changes: 4 additions & 26 deletions packages/core/src/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,19 @@
getIsolationScope,
getClient,
setCurrentClient,
addEventProcessor,
lastEventId,
consoleSandbox,
instrumentOpenAiClient,
instrumentAnthropicAiClient,
instrumentGoogleGenAIClient,
createLangChainCallbackHandler,
instrumentStateGraph,
instrumentStateGraphCompile,
addConsoleInstrumentationFilter,
} from '@sentry/core';

/** @deprecated Use `instrumentStateGraph` instead. `instrumentLangGraph` will be removed in a future major version. */
export { instrumentLangGraph } from '@sentry/core';

export type {
OpenAiClient,
OpenAiOptions,
InstrumentedMethod,
AnthropicAiClient,
AnthropicAiOptions,
AnthropicAiInstrumentedMethod,
AnthropicAiResponse,
GoogleGenAIClient,
GoogleGenAIChat,
GoogleGenAIOptions,
LangChainOptions,
LangChainIntegration,
LangGraphOptions,
LangGraphIntegration,
CompiledGraph,
} from '@sentry/core';
// NOTE: The AI instrumentation helpers (OpenAI, Anthropic, Google GenAI, LangChain,
// LangGraph) and their types were removed from `@sentry/core` in JS v11 and moved to
// the server-only `@sentry/server-utils` package, which React Native does not depend
// on. They are therefore no longer re-exported here.

export {
ErrorBoundary,

Check failure on line 62 in packages/core/src/js/index.ts

View check run for this annotation

@sentry/warden / warden: code-review

[TU5-K4F] Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test (additional location)

The v11 adaptation removes `instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`/`instrumentStateGraph*`, and related types from the `@sentry/react-native` entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains `8.24.0`. This is an unannounced public API break, and `packages/core/test/aiExports.test.ts` still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; `@sentry/server-utils` is server-only and is not a drop-in React Native replacement.
withErrorBoundary,
createReduxEnhancer,
Profiler,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/js/integrations/deeplink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { IntegrationFn } from '@sentry/core';

import { addBreadcrumb, defineIntegration, getClient } from '@sentry/core';

import type { ReactNativeClientOptions } from '../options';
import type { DeepLinkSource } from '../tracing/pendingDeepLink';

import { setPendingDeepLink } from '../tracing/pendingDeepLink';
Expand Down Expand Up @@ -57,7 +58,7 @@ export function sanitizeDeepLinkUrl(url: string): string {
* When PII is disabled, query strings and ID-like path segments are removed.
*/
function getBreadcrumbUrl(url: string): string {
const sendDefaultPii = getClient()?.getOptions()?.sendDefaultPii ?? false;
const sendDefaultPii = (getClient()?.getOptions() as ReactNativeClientOptions | undefined)?.sendDefaultPii ?? false;
return sendDefaultPii ? url : sanitizeDeepLinkUrl(url);
}

Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/js/integrations/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export {
globalHandlersIntegration as browserGlobalHandlersIntegration,
httpClientIntegration,
httpContextIntegration,
inboundFiltersIntegration,
// `inboundFiltersIntegration` was renamed to `eventFiltersIntegration` in JS v11.
// Keep the existing public name to avoid breaking the SDK's own API surface.
eventFiltersIntegration as inboundFiltersIntegration,
linkedErrorsIntegration as browserLinkedErrorsIntegration,
rewriteFramesIntegration,
extraErrorDataIntegration,
Expand Down
21 changes: 13 additions & 8 deletions packages/core/src/js/integrations/nativelinkederrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,28 @@ function walkErrorTree(

let exception: Exception;
let exceptionDebugImages: DebugImage[] | undefined;
// `error[key]` is `unknown` since JS v11 tightened `ExtendedError`'s index
// signature from `any` to `unknown`; the branches below runtime-check its
// shape before narrowing, and cast to the concrete native shapes the helpers
// expect (this data originates untyped from the native layer).
if (isString(linkedError)) {
exception = {
value: linkedError,
};
} else if ('stackElements' in linkedError) {
} else if (isPlainObject(linkedError) && 'stackElements' in linkedError) {
// isJavaException
exception = exceptionFromJavaStackElements(linkedError);
} else if ('stackReturnAddresses' in linkedError) {
exception = exceptionFromJavaStackElements(linkedError as Parameters<typeof exceptionFromJavaStackElements>[0]);
} else if (isPlainObject(linkedError) && 'stackReturnAddresses' in linkedError) {
// isObjCException
const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);
const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(
linkedError as Parameters<typeof exceptionFromAppleStackReturnAddresses>[0],
);
exception = appleException;
exceptionDebugImages = appleDebugImages;
} else if (isInstanceOf(linkedError, Error)) {
exception = exceptionFromError(parser, error[key]);
exception = exceptionFromError(parser, linkedError);
} else if (isPlainObject(linkedError)) {
// oxlint-disable-next-line typescript-eslint(no-unnecessary-type-assertion)
const plainError = linkedError as Record<string, unknown>;
const plainError = linkedError;
exception = {
type: typeof plainError.name === 'string' ? plainError.name : undefined,
value: typeof plainError.message === 'string' ? plainError.message : undefined,
Expand All @@ -122,7 +127,7 @@ function walkErrorTree(
return walkErrorTree(
parser,
limit,
linkedError,
linkedError as ExtendedError,
key,
[...exceptions, exception],
[...debugImages, ...(exceptionDebugImages || [])],
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/js/integrations/turboModuleContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* oxlint-disable eslint(max-lines) */
import type { Client, Event, Integration, Span, TransactionEvent } from '@sentry/core';

import { addBreadcrumb, debug, spanToJSON } from '@sentry/core';
import { addBreadcrumb, debug, spanToStaticSpanJSON } from '@sentry/core';

import {
addTurboModuleCallStartObserver,
Expand Down Expand Up @@ -438,7 +438,7 @@ function attachWindowToSpan(
window.writtenPerMethodKeys = nextKeys;

if (rows.length > topN) {
const spanId = spanToJSON(span).span_id;
const spanId = spanToStaticSpanJSON(span).span_id;
debug.log(
`[TurboModuleContext] Span ${spanId ?? '(unknown)'} touched ${rows.length} unique TurboModule methods, ` +
`truncated to top ${topN} by duration. Summary attributes still reflect the full totals.`,
Expand All @@ -447,7 +447,7 @@ function attachWindowToSpan(

span.setAttributes(attributes);

const spanId = spanToJSON(span).span_id;
const spanId = spanToStaticSpanJSON(span).span_id;
if (spanId) {
if (!pendingSpanAttributes.has(spanId) && pendingSpanAttributes.size >= MAX_PENDING_SPAN_ATTRIBUTES) {
const oldest = pendingSpanAttributes.keys().next().value;
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,17 @@ export interface BaseReactNativeOptions {
*/
propagateTraceparent?: boolean;

/**
* Enables sending log events to Sentry.
*
* On the JavaScript layer this used to be a `@sentry/core` option. As of JS SDK v11 the option
* was removed from core (logs are captured on-usage there), so the React Native SDK owns it to
* keep gating native log capture and its `logsOrigin` orchestration.
*
* @default false
*/
enableLogs?: boolean;

/**
* Controls which log origin is captured when `enableLogs` is set to true.
* 'all' will log all origins.
Expand Down
12 changes: 11 additions & 1 deletion packages/core/src/js/replay/xhrUtils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import type { Breadcrumb, BreadcrumbHint, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/core';
import type { Breadcrumb, BreadcrumbHint, XhrBreadcrumbHint } from '@sentry/core';

import { dropUndefinedKeys } from '@sentry/core';

import type { NetworkBody, RequestBody, ResolvedNetworkOptions } from './networkUtils';

// `SentryWrappedXMLHttpRequest` / `SentryXhrData` were removed from `@sentry/core` in
// JS v11. Declare the subset this module relies on locally.
interface SentryXhrData {
request_headers: Record<string, string>;
}

interface SentryWrappedXMLHttpRequest {
__sentry_xhr_v3__?: SentryXhrData;
}

import {
decodeUtf8,
filterHeaders,
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/js/tracing/expoRouter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { addBreadcrumb, getClient, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startInactiveSpan } from '@sentry/core';

import type { ReactNativeClientOptions } from '../options';

import { SPAN_ORIGIN_AUTO_EXPO_ROUTER_NAVIGATION, SPAN_ORIGIN_AUTO_EXPO_ROUTER_PREFETCH } from './origin';
import { clearPendingExpoRouterNavigation, setPendingExpoRouterNavigation } from './pendingExpoRouterNavigation';

Expand Down Expand Up @@ -239,5 +241,5 @@ function serializeHref(href: unknown): string {
}

function isSendDefaultPiiEnabled(): boolean {
return getClient()?.getOptions()?.sendDefaultPii ?? false;
return (getClient()?.getOptions() as ReactNativeClientOptions | undefined)?.sendDefaultPii ?? false;
}
Loading
Loading