Skip to content

Commit eafdd89

Browse files
author
Tomas Familia
committed
added env variable
1 parent c42ed06 commit eafdd89

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

src/instrumentation-client.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,31 @@
33
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
44

55
import * as Sentry from "@sentry/nextjs";
6+
import { version, name } from '../package.json';
67

78
Sentry.init({
8-
dsn: "https://ed6e1c11f9473fd35746d8c7b7d69a45@o4510833463328768.ingest.us.sentry.io/4510833468178432",
9+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
910

1011
// Add optional integrations for additional features
11-
integrations: [Sentry.replayIntegration()],
12+
integrations: [Sentry.replayIntegration({
13+
// Additional Replay configuration goes in here, for example:
14+
maskAllText: false,
15+
blockAllMedia: true,
16+
})],
1217

1318
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
1419
tracesSampleRate: 1,
1520
// Enable logs to be sent to Sentry
1621
enableLogs: true,
1722

23+
debug: false,
24+
25+
enabled: process.env.NODE_ENV === 'production',
26+
27+
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
28+
29+
release: `${name}@${version}`,
30+
1831
// Define how likely Replay events are sampled.
1932
// This sets the sample rate to be 10%. You may want this to be 100% while
2033
// in development and sample at a lower rate in production
@@ -29,3 +42,4 @@ Sentry.init({
2942
});
3043

3144
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
45+
export const onRequestError = Sentry.captureRequestError;

0 commit comments

Comments
 (0)