Skip to content

Commit c6a7500

Browse files
authored
feat(replays): Add more example snippets for Replay onboarding (#5727)
1 parent 9191025 commit c6a7500

File tree

17 files changed

+446
-2
lines changed

17 files changed

+446
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Install
9+
10+
For the sentry-replay integration to work, you must have the Sentry browser SDK package (minimum version 7.x), or an equivalent framework SDK (e.g. @sentry/react) installed.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/angular @sentry/replay
15+
16+
# Using npm
17+
npm install --save @sentry/angular @sentry/replay
18+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Configure
9+
10+
Add the following to your SDK config. There are several privacy and performance options available, all of which can be set via the `integrations` constructor. Learn more about configuring Replay in our Github [Readme](https://github.com/getsentry/sentry-replay/blob/main/README.md).
11+
12+
```javascript
13+
import * as Sentry from "@sentry/angular";
14+
import { Replay } from "@sentry/replay";
15+
16+
Sentry.init({
17+
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
18+
integrations: [
19+
new Replay({
20+
// Capture 10% of all sessions
21+
sessionSampleRate: 0.1,
22+
23+
// Of the remaining 90% of sessions, if an error happens start capturing
24+
errorSampleRate: 1.0,
25+
})
26+
],
27+
});
28+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Install
9+
10+
For the sentry-replay integration to work, you must have the Sentry browser SDK package (minimum version 7.x), or an equivalent framework SDK (e.g. @sentry/react) installed.
11+
12+
```bash {tabTitle:ember-cli}
13+
ember install @sentry/ember @sentry/replay
14+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Configure
9+
10+
Add the following to your SDK config. There are several privacy and performance options available, all of which can be set via the `integrations` constructor. Learn more about configuring Replay in our Github [Readme](https://github.com/getsentry/sentry-replay/blob/main/README.md).
11+
12+
```javascript
13+
import * as Sentry from "@sentry/ember";
14+
import { Replay } from "@sentry/replay";
15+
16+
Sentry.init({
17+
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
18+
integrations: [
19+
new Replay({
20+
// Capture 10% of all sessions
21+
sessionSampleRate: 0.1,
22+
23+
// Of the remaining 90% of sessions, if an error happens start capturing
24+
errorSampleRate: 1.0,
25+
})
26+
],
27+
});
28+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Install
9+
10+
For the sentry-replay integration to work, you must have the Sentry browser SDK package (minimum version 7.x), or an equivalent framework SDK (e.g. @sentry/react) installed.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/gatsby @sentry/replay
15+
16+
# Using npm
17+
npm install --save @sentry/gatsby @sentry/replay
18+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Configure
9+
10+
Add the following to your SDK config. There are several privacy and performance options available, all of which can be set via the `integrations` constructor. Learn more about configuring Replay in our Github [Readme](https://github.com/getsentry/sentry-replay/blob/main/README.md).
11+
12+
Include the `@sentry/gatsby` plugin:
13+
14+
```javascript {filename:gatsby-config.js}
15+
module.exports = {
16+
plugins: [
17+
{
18+
resolve: "@sentry/gatsby",
19+
},
20+
]
21+
};
22+
```
23+
24+
Configure your `Sentry.init`:
25+
26+
```javascript {filename:sentry.config.js}
27+
import * as Sentry from "@sentry/gatsby";
28+
import { Replay } from "@sentry/replay";
29+
30+
Sentry.init({
31+
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
32+
integrations: [
33+
new Replay({
34+
// Capture 10% of all sessions
35+
sessionSampleRate: 0.1,
36+
37+
// Of the remaining 90% of sessions, if an error happens start capturing
38+
errorSampleRate: 1.0,
39+
})
40+
],
41+
});
42+
```
43+
44+
Note: If `gatsby-config.js` has any settings for the `@sentry/gatsby` plugin they need to be moved into `sentry.config.js`. `gatsby-config.js` doesn't support non-serializable options, like `new Replay()`.

src/wizard/javascript/replay-onboarding/javascript/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as Sentry from "@sentry/browser";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
17-
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
17+
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
1818
integrations: [
1919
new Replay({
2020
// Capture 10% of all sessions
@@ -24,5 +24,5 @@ Sentry.init({
2424
errorSampleRate: 1.0,
2525
})
2626
],
27-
})
27+
});
2828
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Install
9+
10+
For the sentry-replay integration to work, you must have the Sentry browser SDK package (minimum version 7.x), or an equivalent framework SDK (e.g. @sentry/react) installed.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/nextjs @sentry/replay
15+
16+
# Using npm
17+
npm install --save @sentry/nextjs @sentry/replay
18+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Configure
9+
10+
Add the following to your Client SDK config. There are several privacy and performance options available, all of which can be set via the `integrations` constructor. Learn more about configuring Replay in our Github [Readme](https://github.com/getsentry/sentry-replay/blob/main/README.md).
11+
12+
```javascript {filename:sentry.client.config.js}
13+
import * as Sentry from "@sentry/nextjs";
14+
import { Replay } from "@sentry/replay";
15+
16+
Sentry.init({
17+
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
18+
integrations: [
19+
new Replay({
20+
// Capture 10% of all sessions
21+
sessionSampleRate: 0.1,
22+
23+
// Of the remaining 90% of sessions, if an error happens start capturing
24+
errorSampleRate: 1.0,
25+
})
26+
],
27+
});
28+
```
29+
30+
Note: The `@sentry/repaly` integration only needs to be added to your `sentry.client.config.js` file. There will be no effect if it is added into `sentry.server.config.js`.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: JavaScript
3+
doc_link: https://docs.sentry.io/platforms/javascript/replay/
4+
support_level: production
5+
type: language
6+
---
7+
8+
#### Install
9+
10+
For the sentry-replay integration to work, you must have the Sentry browser SDK package (minimum version 7.x), or an equivalent framework SDK (e.g. @sentry/react) installed.
11+
12+
```bash
13+
# Using yarn
14+
yarn add @sentry/react @sentry/replay
15+
16+
# Using npm
17+
npm install --save @sentry/react @sentry/replay
18+
```

0 commit comments

Comments
 (0)