@exmg/lit-helpers
Version:
Package aimed to expose helpers function for CMS development
23 lines • 808 B
JavaScript
import * as Sentry from '@sentry/browser';
export const initSentry = (config) => {
if (!['localhost', '127.0.0.1', ''].includes(window.location.hostname)) {
if (!(config === null || config === void 0 ? void 0 : config.dsn)) {
console.warn('Sentry DSN is required to initialize Sentry');
return;
}
const sentryConfig = Object.assign({
release: `exmg-cms`,
environment: 'development',
attachStacktrace: true,
}, config);
console.info('Initialized Sentry', sentryConfig);
Sentry.init(sentryConfig);
}
else {
console.info('Sentry disabled running locally');
}
};
export const captureException = (error) => {
Sentry.captureException(error);
};
//# sourceMappingURL=index.js.map