Skip to content

Commit

Permalink
fix(docs): improve mobile replay docs (#11192)
Browse files Browse the repository at this point in the history
  • Loading branch information
michellewzhang authored and Zylphrex committed Sep 4, 2024
1 parent 6927648 commit da702ff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/platforms/android/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ plugins {
```

If you have the SDK installed without the Sentry Gradle Plugin, you can update the version directly in the `build.gradle` through:

```groovy {filename:app/build.gradle}
dependencies {
implementation 'io.sentry:sentry-android:{{@inject packages.version('sentry.java.android', '7.12.0') }}'
Expand Down Expand Up @@ -67,12 +68,11 @@ SentryAndroid.init(context) { options ->
}
```

```xml {filename:AndroidManifest.xml}
```XML {filename:AndroidManifest.xml}
<meta-data android:name="io.sentry.session-replay.error-sample-rate" android:value="1.0" />
<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="1.0" />
```


## Verify

While you're testing, we recommend that you set `sessionSampleRate` to `1.0`. This ensures that every user session will be sent to Sentry.
Expand Down
6 changes: 3 additions & 3 deletions docs/platforms/apple/guides/ios/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ If you already have the SDK installed, you can update it to the latest version w
```swift {tabTitle:SPM}
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "{{@inject packages.version('sentry.cocoa') }}"),
```
```ruby {tabTitle:Cocoapods}

```ruby {tabTitle:CocoaPods}
pod update
```

```ruby {tabTitle:Carthage}
github "getsentry/sentry-cocoa" "{{@inject packages.version('sentry.cocoa') }}"
```


## Set Up

To set up the integration, add the following to your Sentry initialization.
Expand All @@ -51,7 +52,6 @@ SentrySDK.start(configureOptions: { options in
})
```


## Verify

While you're testing, we recommend that you set `sessionSampleRate` to `1.0`. This ensures that every user session will be sent to Sentry.
Expand Down
25 changes: 12 additions & 13 deletions docs/platforms/react-native/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Make sure your Sentry React Native SDK version is at least 5.26.0.
## Install

If you already have the SDK installed, you can update it to the latest version with:

```bash {tabTitle:npm}
npm install @sentry/react-native --save
```
Expand All @@ -41,24 +42,18 @@ pnpm add @sentry/react-native
To set up the integration, add the following to your Sentry initialization.

```javascript
import * as Sentry from '@sentry/react-native';
import * as Sentry from "@sentry/react-native";

Sentry.init({
dsn = "___PUBLIC_DSN___",
dsn: "___PUBLIC_DSN___",
_experiments: {
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
},
integrations: [
Sentry.mobileReplayIntegration({
maskAllText: true,
maskAllImages: true,
}),
],
integrations: [Sentry.mobileReplayIntegration()],
});
```


## Verify

While you're testing, we recommend that you set <PlatformIdentifier name="replays-session-sample-rate" /> to `1.0`. This ensures that every user session will be sent to Sentry.
Expand Down Expand Up @@ -117,14 +112,18 @@ MyCard (View, MyCard.ts) > MyButton (Touchable, MyCard.ts) > View > Text
To add React Component Names use `annotateReactComponents` in `metro.config.js`.

```js {tabTitle: React Native}
const { getDefaultConfig } = require('@react-native/metro-config');
const { withSentryConfig } = require('@sentry/react-native/metro');
module.exports = withSentryConfig(getDefaultConfig(__dirname), { annotateReactComponents: true });
const { getDefaultConfig } = require("@react-native/metro-config");
const { withSentryConfig } = require("@sentry/react-native/metro");
module.exports = withSentryConfig(getDefaultConfig(__dirname), {
annotateReactComponents: true,
});
```

```js {tabTitle: Expo}
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
const config = getSentryExpoConfig(__dirname, { annotateReactComponents: true });
const config = getSentryExpoConfig(__dirname, {
annotateReactComponents: true,
});
```

## Error Linking
Expand Down

0 comments on commit da702ff

Please sign in to comment.