mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 23:04:57 +00:00
- codegen: Low-code React app with JSON-driven component system - packagerepo: Schema-driven package repository with backend/frontend - postgres: Next.js app with Drizzle ORM and PostgreSQL Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import * as Sentry from '@sentry/nextjs';
|
|
|
|
const sentryOptions: Sentry.NodeOptions | Sentry.EdgeOptions = {
|
|
// Sentry DSN
|
|
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
|
|
// Enable Spotlight in development
|
|
spotlight: process.env.NODE_ENV === 'development',
|
|
|
|
integrations: [
|
|
Sentry.consoleLoggingIntegration(),
|
|
],
|
|
|
|
// Adds request headers and IP for users, for more info visit
|
|
sendDefaultPii: true,
|
|
|
|
// Adjust this value in production, or use tracesSampler for greater control
|
|
tracesSampleRate: 1,
|
|
|
|
// Enable logs to be sent to Sentry
|
|
enableLogs: true,
|
|
|
|
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
debug: false,
|
|
};
|
|
|
|
export async function register() {
|
|
if (!process.env.NEXT_PUBLIC_SENTRY_DISABLED) {
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
// Node.js Sentry configuration
|
|
Sentry.init(sentryOptions);
|
|
}
|
|
|
|
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
// Edge Sentry configuration
|
|
Sentry.init(sentryOptions);
|
|
}
|
|
}
|
|
}
|
|
|
|
export const onRequestError = Sentry.captureRequestError;
|