diff --git a/docs/platforms/react-native/enriching-events/scopes/index.mdx b/docs/platforms/react-native/enriching-events/scopes/index.mdx index c76596575cdb1..dc6b359e82276 100644 --- a/docs/platforms/react-native/enriching-events/scopes/index.mdx +++ b/docs/platforms/react-native/enriching-events/scopes/index.mdx @@ -138,10 +138,10 @@ Scope attributes are key-value pairs that are automatically included in structur ```javascript // Set a single attribute -Sentry.getIsolationScope().setAttribute("org_id", "abc123"); +Sentry.setAttribute("org_id", "abc123"); // Set multiple attributes at once -Sentry.getIsolationScope().setAttributes({ +Sentry.setAttributes({ user_tier: "premium", request_count: 42, is_admin: true, @@ -151,6 +151,8 @@ Sentry.getIsolationScope().setAttributes({ Sentry.getIsolationScope().removeAttribute("org_id"); ``` +The top-level `Sentry.setAttribute` and `Sentry.setAttributes` methods set data on the isolation scope. You can also call them on a specific scope, for example `Sentry.getIsolationScope().setAttribute(...)`. + Attributes support primitive values: strings, numbers, and booleans. Non-primitive values (objects, arrays, etc.) are not synced to the native layer. You can also set attributes within a specific scope using `withScope`: