Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sentry.client.config.ts → instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { EventHint } from "@sentry/nextjs";
Sentry.init({
dsn,

sendDefaultPii: true,

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,

Expand All @@ -26,15 +28,18 @@ Sentry.init({
}
return event;
},

integrations: [
Sentry.replayIntegration({
maskAllText: true,
unmask: ["aside", "header", "nav"],
blockAllMedia: true,
unblock: [],

networkDetailAllowUrls: [window.location.origin, 'https://graphql-pokeapi.graphcdn.app/'],
networkDetailAllowUrls: [
window.location.origin,
"https://graphql-pokeapi.graphcdn.app/",
],
networkDetailDenyUrls: [
window.location.origin + "/_next/",
window.location.origin + "/monitoring",
Expand All @@ -60,3 +65,5 @@ Sentry.init({
}),
],
});

export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
9 changes: 9 additions & 0 deletions instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./sentry.server.config");
}

if (process.env.NEXT_RUNTIME === "edge") {
await import("./sentry.edge.config");
}
}
50 changes: 20 additions & 30 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,25 @@ const nextConfig = {

const { withSentryConfig } = require("@sentry/nextjs");

module.exports = withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
module.exports = withSentryConfig(nextConfig, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: false,
// Suppresses source map uploading logs during build
silent: false,

org: 'sentry-test',
project: 'pokemart',
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: false,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
// tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
);
org: "sentry-test",
project: "pokemart",

// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
// tunnelRoute: "/monitoring",

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
});
Loading
Loading