@sentry/core 10.61.0 added top-level Sentry.setAttribute(key, value) and Sentry.setAttributes(attrs) APIs (getsentry/sentry-javascript#21705). The RN SDK re-exports core via an explicit allowlist (packages/core/src/js/index.ts), so these are not currently exposed to RN users.
This is a low-priority parity enhancement, not a bug — RN users can already call getCurrentScope().setAttribute(...), which works and syncs to native today.
Why it's safe/cheap: the new functions delegate to getIsolationScope().setAttribute(s), and RN already patches the isolation scope (enableSyncToNative(getIsolationScope()) in sdk.tsx) to forward primitive attributes to native. So exposing them gets native scope-sync for free — no extra wiring.
Scope of work:
@sentry/core10.61.0 added top-levelSentry.setAttribute(key, value)andSentry.setAttributes(attrs)APIs (getsentry/sentry-javascript#21705). The RN SDK re-exports core via an explicit allowlist (packages/core/src/js/index.ts), so these are not currently exposed to RN users.This is a low-priority parity enhancement, not a bug — RN users can already call
getCurrentScope().setAttribute(...), which works and syncs to native today.Why it's safe/cheap: the new functions delegate to
getIsolationScope().setAttribute(s), and RN already patches the isolation scope (enableSyncToNative(getIsolationScope())insdk.tsx) to forward primitive attributes to native. So exposing them gets native scope-sync for free — no extra wiring.Scope of work:
setAttribute, setAttributesto theexport { … } from '@sentry/core'block inpackages/core/src/js/index.tsyarn build:sdk && yarn api-report)Sentry.setAttribute('k', 'v')forwards toNATIVE.setAttribute(isolation-scope → native path)