Skip to content
Open
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
6 changes: 4 additions & 2 deletions docs/platforms/react-native/enriching-events/scopes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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`:
Expand Down
Loading