Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-garcia committed Sep 19, 2023
1 parent 91171b7 commit ac2bca0
Show file tree
Hide file tree
Showing 11 changed files with 370 additions and 12 deletions.
45 changes: 45 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.angular.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```javascript
import * as Sentry from "@sentry/angular-ivy";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/angular-ivy");
getCurrentHub().getClient().addIntegration(new Replay());
```
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
To set up the integration, add the following to your Sentry initialization in
Electron renderers. Several options are supported and passable using the integration
constructor. See the [configuration
documentation](/platforms/javascript/session-replay/configuration/) for more
details.

<SignInNote />

```javascript
import * as Sentry from "@sentry/electron/renderer";

Expand Down
45 changes: 45 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```javascript
import * as Sentry from "@sentry/ember";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/ember");
getCurrentHub().getClient().addIntegration(new Replay());
```
4 changes: 0 additions & 4 deletions src/platform-includes/session-replay/setup/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
To set up the integration, add the following to your Sentry initialization. Several options are supported and passable using the integration constructor. See the [configuration documentation](/platforms/javascript/session-replay/configuration/) for more details.

<SignInNote />

```javascript
// import Sentry from your framework SDK (e.g. @sentry/react) instead of @sentry/browser
import * as Sentry from "@sentry/browser";
Expand Down
47 changes: 47 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.nextjs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
```javascript
On your client-side NextJS app, add:

import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/nextjs");
getCurrentHub().getClient().addIntegration(new Replay());
```
45 changes: 45 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.react.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```javascript
import * as Sentry from "@sentry/react";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/react");
getCurrentHub().getClient().addIntegration(new Replay());
```
47 changes: 47 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.remix.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
On your client-side Remix app, add:

```javascript
import * as Sentry from "@sentry/remix";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/remix");
getCurrentHub().getClient().addIntegration(new Replay());
```
45 changes: 45 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.svelte.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```javascript
import * as Sentry from "@sentry/svelte";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/svelte");
getCurrentHub().getClient().addIntegration(new Replay());
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
On your client-side SvelteKit app, add:

```javascript
import * as Sentry from "@sentry/sveltekit";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/sveltekit");
getCurrentHub().getClient().addIntegration(new Replay());
```
45 changes: 45 additions & 0 deletions src/platform-includes/session-replay/setup/javascript.vue.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```javascript
import * as Sentry from "@sentry/vue";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

integrations: [
new Sentry.Replay({
// Additional SDK configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
```

With the settings above, session replays with errors are always captured.
You can verify that with the following:

```javascript
myUndefinedFunction();
```

### Lazy-loading Replay

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
});

// Sometime later
const { getCurrentHub, Replay } = await import("@sentry/vue");
getCurrentHub().getClient().addIntegration(new Replay());
```
Loading

0 comments on commit ac2bca0

Please sign in to comment.