Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Features

- Expose top-level `Sentry.setAttribute` and `Sentry.setAttributes` APIs ([#6354](https://github.com/getsentry/sentry-react-native/pull/6354)).
- Use the runtime's native `btoa` for envelope base64 encoding when available, to improve `captureEnvelope` performance. Falls back to the bundled JS encoder if `btoa` is missing ([#6351](https://github.com/getsentry/sentry-react-native/pull/6351)).

## 8.16.0
Expand Down
6 changes: 6 additions & 0 deletions packages/core/etc/sentry-react-native.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ import { rewriteFramesIntegration } from '@sentry/react';
import { Scope } from '@sentry/core';
import { SdkInfo } from '@sentry/core';
import { SendFeedbackParams } from '@sentry/core';
import { setAttribute } from '@sentry/core';
import { setAttributes } from '@sentry/core';
import { setContext } from '@sentry/core';
import { setCurrentClient } from '@sentry/core';
import { setExtra } from '@sentry/core';
Expand Down Expand Up @@ -711,6 +713,10 @@ export interface SentryNavigationContainerProps {
export function sentryTraceGesture<GestureT>(
label: string, gesture: GestureT): GestureT;

export { setAttribute }

export { setAttributes }

export { setContext }

export { setCurrentClient }
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export {
captureFeedback,
captureMessage,
Scope,
setAttribute,
setAttributes,
setContext,
setExtra,
setExtras,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/scopeSync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('ScopeSync', () => {
it('setAttribute', () => {
expect(SentryCore.getIsolationScope().setAttribute).not.toBe(setAttributeScopeSpy);

SentryCore.getIsolationScope().setAttribute('session_id', 'abc123');
SentryCore.setAttribute('session_id', 'abc123');
expect(NATIVE.setAttribute).toHaveBeenCalledExactlyOnceWith('session_id', 'abc123');
expect(setAttributeScopeSpy).toHaveBeenCalledExactlyOnceWith('session_id', 'abc123');
});
Expand All @@ -249,7 +249,7 @@ describe('ScopeSync', () => {
it('setAttributes', () => {
expect(SentryCore.getIsolationScope().setAttributes).not.toBe(setAttributesScopeSpy);

SentryCore.getIsolationScope().setAttributes({
SentryCore.setAttributes({
session_type: 'test',
request_count: 42,
is_admin: true,
Expand Down
Loading