legacy.js 689 B

123456789101112131415161718192021222324252627
  1. import { getClient } from '@sentry/core';
  2. import { Anr } from './index.js';
  3. // TODO (v8): Remove this entire file and the `enableAnrDetection` export
  4. /**
  5. * @deprecated Use the `Anr` integration instead.
  6. *
  7. * ```ts
  8. * import * as Sentry from '@sentry/node';
  9. *
  10. * Sentry.init({
  11. * dsn: '__DSN__',
  12. * integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true })],
  13. * });
  14. * ```
  15. */
  16. function enableAnrDetection(options) {
  17. const client = getClient() ;
  18. // eslint-disable-next-line deprecation/deprecation
  19. const integration = new Anr(options);
  20. integration.setup(client);
  21. return Promise.resolve();
  22. }
  23. export { enableAnrDetection };
  24. //# sourceMappingURL=legacy.js.map