mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-21 11:59:54 -06:00
19 lines
605 B
TypeScript
19 lines
605 B
TypeScript
import { IS_PRODUCTION, PROMETHEUS_ENABLED, SENTRY_DSN } from "@/lib/constants";
|
|
import * as Sentry from "@sentry/nextjs";
|
|
|
|
export const onRequestError = Sentry.captureRequestError;
|
|
|
|
export const register = async () => {
|
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
if (PROMETHEUS_ENABLED) {
|
|
await import("./instrumentation-node");
|
|
}
|
|
}
|
|
if (process.env.NEXT_RUNTIME === "nodejs" && IS_PRODUCTION && SENTRY_DSN) {
|
|
await import("./sentry.server.config");
|
|
}
|
|
if (process.env.NEXT_RUNTIME === "edge" && IS_PRODUCTION && SENTRY_DSN) {
|
|
await import("./sentry.edge.config");
|
|
}
|
|
};
|