// src/sentry.ts
var initialized = false;
function initSentry() {
  if (initialized) return;
  initialized = true;
  const dsn = process.env.SENTRY_DSN;
  if (!dsn) return;
  try {
    import("@sentry/node").then((Sentry) => {
      Sentry.init({
        dsn,
        environment: process.env.NODE_ENV || "production",
        release: process.env.GATEWAY_VERSION || "dev",
        tracesSampleRate: 0.1,
        // Don't send PII
        sendDefaultPii: false
      });
      console.log("[sentry] initialized");
    }).catch(() => {
    });
  } catch {
  }
}
function captureException(err) {
  try {
    import("@sentry/node").then((Sentry) => {
      Sentry.captureException(err);
    }).catch(() => {
    });
  } catch {
  }
}

export {
  initSentry,
  captureException
};
