hongbo-miao/hongbomiao.com

View on GitHub
web/src/shared/utils/analytics.ts

Summary

Maintainability
A
0 mins
Test Coverage
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import googleTagManager from '@analytics/google-tag-manager';
import Analytics from 'analytics';
import config from '../../config';
import isDevelopment from './isDevelopment';
import isProduction from './isProduction';

const analytics = Analytics({
  app: 'hm-web-analytics',
  debug: isDevelopment(),
  plugins: isProduction() ? [googleTagManager(config.googleTagManagerOptions)] : [],
});

export default analytics;