easy-invoice-pdf/sentry.server.config.ts
VladSez 549fed296c chore: update package manager and Playwright timeout settings; enhance Sentry configuration for better environment checks
- Updated package manager version from pnpm@10.6.5 to pnpm@10.9.0 in package.json.
- Increased Playwright expect assertion timeout from 15 seconds to 25 seconds for improved test reliability.
- Refactored Sentry configuration in client, edge, and server files to utilize environment checks for enabling Sentry and DSN management, ensuring better performance and clarity in production environments.
2025-04-23 23:42:07 +02:00

26 lines
844 B
TypeScript

// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs";
const isCI = process.env.CI === "true";
const isSentryEnabled = process.env.SENTRY_ENABLED === "true" && !isCI;
if (isSentryEnabled) {
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
enabled: isSentryEnabled,
// Adjust sampling in production for better performance/cost balance
tracesSampleRate: 0.15, // Sample 15% of transactions
// Recommended production settings
debug: false,
// Performance settings
replaysSessionSampleRate: 0.1, // Sample 10% of sessions
replaysOnErrorSampleRate: 1.0, // But capture all sessions with errors
});
}