diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4f8fd300..b96c972082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Expose screenshot masking options (`screenshot.maskAllText`, `screenshot.maskAllImages`, `screenshot.maskedViewClasses`, `screenshot.unmaskedViewClasses`) for error screenshots ([#6007](https://github.com/getsentry/sentry-react-native/pull/6007)) - Warn Expo users at Metro startup when prebuilt native projects are missing Sentry configuration ([#5984](https://github.com/getsentry/sentry-react-native/pull/5984)) +- Re-export AI SDK manual instrumentation helpers (`instrumentOpenAiClient`, `instrumentAnthropicAiClient`, `instrumentGoogleGenAIClient`, `createLangChainCallbackHandler`, `instrumentLangGraph`, `instrumentStateGraphCompile`) for use in React Native apps ([#6028](https://github.com/getsentry/sentry-react-native/pull/6028)) - Add `Sentry.GlobalErrorBoundary` component (and `withGlobalErrorBoundary` HOC) that renders a fallback UI for fatal non-rendering JS errors routed through `ErrorUtils` in addition to the render-phase errors caught by `Sentry.ErrorBoundary`. Opt-in flags `includeNonFatalGlobalErrors` and `includeUnhandledRejections` extend the fallback to non-fatal errors and unhandled promise rejections respectively. ([#6023](https://github.com/getsentry/sentry-react-native/pull/6023)) ### Fixes diff --git a/packages/core/src/js/index.ts b/packages/core/src/js/index.ts index 251fed0c30..4ba7051e88 100644 --- a/packages/core/src/js/index.ts +++ b/packages/core/src/js/index.ts @@ -48,6 +48,30 @@ export { addEventProcessor, lastEventId, consoleSandbox, + instrumentOpenAiClient, + instrumentAnthropicAiClient, + instrumentGoogleGenAIClient, + createLangChainCallbackHandler, + instrumentLangGraph, + instrumentStateGraphCompile, +} from '@sentry/core'; + +export type { + OpenAiClient, + OpenAiOptions, + InstrumentedMethod, + AnthropicAiClient, + AnthropicAiOptions, + AnthropicAiInstrumentedMethod, + AnthropicAiResponse, + GoogleGenAIClient, + GoogleGenAIChat, + GoogleGenAIOptions, + LangChainOptions, + LangChainIntegration, + LangGraphOptions, + LangGraphIntegration, + CompiledGraph, } from '@sentry/core'; export { diff --git a/packages/core/test/aiExports.test.ts b/packages/core/test/aiExports.test.ts new file mode 100644 index 0000000000..559ccb6ea8 --- /dev/null +++ b/packages/core/test/aiExports.test.ts @@ -0,0 +1,14 @@ +import * as Sentry from '../src/js'; + +describe('AI SDK manual instrumentation re-exports', () => { + test.each([ + 'instrumentOpenAiClient', + 'instrumentAnthropicAiClient', + 'instrumentGoogleGenAIClient', + 'createLangChainCallbackHandler', + 'instrumentLangGraph', + 'instrumentStateGraphCompile', + ])('re-exports %s from @sentry/core', name => { + expect(typeof (Sentry as Record)[name]).toBe('function'); + }); +});