Skip to content

Commit c42ed06

Browse files
author
Tomas Familia
committed
added env variable in instrumentation-client.ts
1 parent 3962446 commit c42ed06

3 files changed

Lines changed: 10 additions & 55 deletions

File tree

instrumentation-client.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

instrumentation.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/instrumentation.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import * as Sentry from "@sentry/nextjs";
22

3-
export async function register() {
4-
if (process.env.NEXT_RUNTIME === "nodejs") {
5-
await import("../sentry.server.config");
6-
}
3+
import { version, name } from '../package.json';
74

8-
if (process.env.NEXT_RUNTIME === "edge") {
9-
await import("../sentry.edge.config");
10-
}
5+
export function register() {
6+
Sentry.init({
7+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
8+
tracesSampleRate: 1,
9+
debug: false,
10+
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
11+
enabled: process.env.NODE_ENV === 'production',
12+
release: `${name}@${version}`,
13+
});
1114
}
1215

1316
export const onRequestError = Sentry.captureRequestError;

0 commit comments

Comments
 (0)