Skip to content

Commit 566d6f4

Browse files
Add sendDefaultPii: true to React Native init code snippets
1 parent b68ec31 commit 566d6f4

File tree

10 files changed

+39
-2
lines changed

10 files changed

+39
-2
lines changed

docs/platforms/react-native/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ Sentry.init({
7878
// profilesSampleRate is relative to tracesSampleRate.
7979
// Here, we'll capture profiles for 100% of transactions.
8080
profilesSampleRate: 1.0,
81+
// Adds more context data to events (IP address, cookies, user, etc.).
82+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
83+
sendDefaultPii: true,
8184
});
8285
```
8386

docs/platforms/react-native/manual-setup/expo.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ import * as Sentry from "@sentry/react-native";
6464

6565
Sentry.init({
6666
dsn: "___DSN___",
67-
6867
// Set tracesSampleRate to 1.0 to capture 100%
6968
// of transactions for tracing.
7069
// We recommend adjusting this value in production
7170
// Learn more at
7271
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
7372
tracesSampleRate: 1.0,
73+
// profilesSampleRate is relative to tracesSampleRate.
74+
// Here, we'll capture profiles for 100% of transactions.
75+
profilesSampleRate: 1.0,
76+
// Adds more context data to events (IP address, cookies, user, etc.).
77+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
78+
sendDefaultPii: true,
7479
});
7580

7681
function App() {

docs/platforms/react-native/profiling/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Sentry.init({
1818
// Learn more at
1919
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
2020
tracesSampleRate: 1.0,
21+
// Adds more context data to events (IP address, cookies, user, etc.).
22+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
23+
sendDefaultPii: true,
2124
});
2225
```
2326

@@ -44,6 +47,9 @@ Sentry.init({
4447
// profilesSampleRate is relative to tracesSampleRate.
4548
// Here, we'll capture profiles for 100% of transactions.
4649
profilesSampleRate: 1.0,
50+
// Adds more context data to events (IP address, cookies, user, etc.).
51+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
52+
sendDefaultPii: true,
4753
});
4854
```
4955

docs/platforms/react-native/session-replay/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Sentry.init({
4141
replaysSessionSampleRate: 0.1,
4242
replaysOnErrorSampleRate: 1.0,
4343
integrations: [Sentry.mobileReplayIntegration()],
44+
// Adds more context data to events (IP address, cookies, user, etc.).
45+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
46+
sendDefaultPii: true,
4447
});
4548
```
4649

docs/platforms/react-native/tracing/instrumentation/custom-navigation.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Sentry.init({
3232
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
3333
tracesSampleRate: 1.0,
3434
integrations: [customNavigationIntegration({navigator})],
35+
// Adds more context data to events (IP address, cookies, user, etc.).
36+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
37+
sendDefaultPii: true,
3538
});
3639
```
3740

docs/platforms/react-native/tracing/instrumentation/expo-router.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Sentry.init({
2929
tracesSampleRate: 1.0,
3030
integrations: [navigationIntegration],
3131
enableNativeFramesTracking: Constants.executionEnvironment === ExecutionEnvironment.StoreClient, // Only in native builds, not in Expo Go.
32+
// Adds more context data to events (IP address, cookies, user, etc.).
33+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
34+
sendDefaultPii: true,
3235
});
3336

3437
function RootLayout() {

docs/platforms/react-native/tracing/instrumentation/react-native-navigation.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Sentry.init({
2121
navigation: Navigation,
2222
}),
2323
],
24+
// Adds more context data to events (IP address, cookies, user, etc.).
25+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
26+
sendDefaultPii: true,
2427
})
2528
```
2629

docs/platforms/react-native/tracing/instrumentation/user-interaction-instrumentation.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Sentry.init({
3030
enableUserInteractionTracing: true,
3131
tracesSampleRate: 1.0,
3232
integrations: [navigationIntegration],
33+
// Adds more context data to events (IP address, cookies, user, etc.).
34+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
35+
sendDefaultPii: true,
3336
});
3437

3538
const App = () => <View>Your App</View>;

includes/react-native-react-navigation-setup.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const navigationIntegration = Sentry.reactNavigationIntegration({
99
Sentry.init({
1010
dsn: "___PUBLIC_DSN___",
1111
integrations: [navigationIntegration],
12+
// Adds more context data to events (IP address, cookies, user, etc.).
13+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
14+
sendDefaultPii: true,
1215
})
1316

1417
function App = () => {
@@ -36,6 +39,9 @@ const navigationIntegration = Sentry.reactNavigationIntegration({
3639
Sentry.init({
3740
dsn: "___PUBLIC_DSN___",
3841
integrations: [navigationIntegration],
42+
// Adds more context data to events (IP address, cookies, user, etc.).
43+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
44+
sendDefaultPii: true,
3945
})
4046

4147
class App extends React.Component {

platform-includes/performance/configure-sample-rate/react-native.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import * as Sentry from "@sentry/react-native";
55

66
Sentry.init({
77
dsn: "___PUBLIC_DSN___",
8-
98
// We recommend adjusting this value in production, or using tracesSampler
109
// for finer control
1110
tracesSampleRate: 1.0,
11+
// Adds more context data to events (IP address, cookies, user, etc.).
12+
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
13+
sendDefaultPii: true,
1214
});
1315
```

0 commit comments

Comments
 (0)