import * as Sentry from '@sentry/react-native';

export function initSentry() {
  Sentry.init({
    // Replace with your Sentry DSN from https://sentry.io
    dsn: '__YOUR_DSN__',
    tracesSampleRate: 1.0,
    // Disable verbose logging in production
    debug: __DEV__,
    // Attach JS/native stack traces to all events
    attachStacktrace: true,
    environment: __DEV__ ? 'development' : 'production',
  });
}

/** Manually capture an exception (e.g. in a catch block) */
export function captureException(error: unknown) {
  Sentry.captureException(error);
}

/** Add a breadcrumb for tracing user flows */
export function addBreadcrumb(message: string, category = 'app') {
  Sentry.addBreadcrumb({ message, category });
}
