Skip to content
Merged
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
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

## Unreleased

### Features

- Functional integrations ([#3814](https://github.com/getsentry/sentry-react-native/pull/3814))

Instead of installing `@sentry/integrations` and creating integrations using the `new` keyword, you can use direct imports of the functional integrations.

```js
// Before
import * as Sentry from '@sentry/react-native';
import { HttpClient } from '@sentry/integrations';

Sentry.init({
integrations: [
new Sentry.BrowserIntegrations.Dedupe(),
new Sentry.Integration.Screenshot(),
new HttpClient(),
],
});

// After
import * as Sentry from '@sentry/react-native';

Sentry.init({
integrations: [
Sentry.dedupeIntegration(),
Sentry.screenshotIntegration(),
Sentry.httpClientIntegration(),
],
});
```

Note that the `Sentry.BrowserIntegrations`, `Sentry.Integration` and the Class style integrations will be removed in the next major version of the SDK.

### Fixes

- Remove unused `rnpm` config ([#3811](https://github.com/getsentry/sentry-react-native/pull/3811))
Expand Down
11 changes: 9 additions & 2 deletions src/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export {
export { lastEventId } from '@sentry/browser';

import * as Integrations from './integrations';
import { SDK_NAME, SDK_VERSION } from './version';

export * from './integrations/exports';

export { SDK_NAME, SDK_VERSION } from './version';
export type { ReactNativeOptions } from './options';
export { ReactNativeClient } from './client';

Expand Down Expand Up @@ -100,4 +103,8 @@ export {
} from './tracing';

export type { ReactNavigationTransactionContext, TimeToDisplayProps } from './tracing';
export { Integrations, SDK_NAME, SDK_VERSION };

export {
/** @deprecated Import the integration function directly, e.g. `screenshotIntegration()` instead of `new Integrations.Screenshot(). */
Integrations,
};
Loading