Skip to content

Commit

Permalink
ref: Replace new Replay() with replayIntegration (#532)
Browse files Browse the repository at this point in the history
* ref(sveltekit): Replace `new Replay()` with `replayIntegration`

* ref(nextjs): Replace `new Replay()` with `replayIntegration`

* ref(remix): Replace `new Replay()` with `replayIntegration`

* changelog

* unreleased
  • Loading branch information
Lms24 authored Feb 1, 2024
1 parent 5b3312c commit 2678334
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

- ref(nextjs): Replace `new Replay()` with `replayIntegration` (#532)
- ref(remix): Replace `new Replay()` with `replayIntegration` (#532)
- ref(sveltekit): Replace `new Replay()` with `replayIntegration` (#532)

## 3.20.2

- ref(wizard): Print error object if wizard endpoint API request failed (#524)
Expand Down
2 changes: 1 addition & 1 deletion src/nextjs/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function getSentryConfigContents(
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
new Sentry.Replay({
Sentry.replayIntegration({
// Additional Replay configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
Expand Down
3 changes: 2 additions & 1 deletion src/remix/sdk-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function insertClientInitCall(
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [
// TODO: Replace as soon as we have the new browserTracingIntegration for Remix
builders.newExpression('Sentry.BrowserTracing', {
routingInstrumentation: builders.functionCall(
'Sentry.remixRouterInstrumentation',
Expand All @@ -86,7 +87,7 @@ function insertClientInitCall(
builders.raw('useMatches'),
),
}),
builders.newExpression('Sentry.Replay'),
builders.functionCall('Sentry.replayIntegration'),
],
});

Expand Down
2 changes: 1 addition & 1 deletion src/sveltekit/sdk-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function insertClientInitCall(
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [builders.newExpression('Sentry.Replay')],
integrations: [builders.functionCall('Sentry.replayIntegration')],
});

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Expand Down
4 changes: 2 additions & 2 deletions src/sveltekit/templates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function getClientHooksTemplate(dsn: string) {
return `import { handleErrorWithSentry, Replay } from "@sentry/sveltekit";
return `import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
import * as Sentry from '@sentry/sveltekit';
Sentry.init({
Expand All @@ -15,7 +15,7 @@ Sentry.init({
replaysOnErrorSampleRate: 1.0,
// If you don't want to use Session Replay, just remove the line below:
integrations: [new Replay()],
integrations: [replayIntegration()],
});
// If you have a custom error handler, pass it to \`handleErrorWithSentry\`
Expand Down

0 comments on commit 2678334

Please sign in to comment.