{"size": 636, "ext": "js", "max_stars_repo_path": "src/counter.js", "max_stars_repo_name": "greanlnwFX/awmonitor", "max_stars_repo_stars_event_min_datetime": "2021-06-21T08:48:30.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-21T12:36:50.000Z", "max_issues_repo_path": "src/counter.js", "max_issues_repo_name": "kentina/awmonitor", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/counter.js", "max_forks_repo_name": "kentina/awmonitor", "max_forks_repo_forks_event_min_datetime": "2021-07-04T15:15:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-04T15:15:06.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.7142857143, "max_line_length": 85, "alphanum_fraction": 0.5943396226}
const appURL = import.meta.env.VITE_APP_URL
const userID = import.meta.env.VITE_COUNTER_ID

export default {
  install: () => {
    if (!userID || typeof window == 'undefined') {
      return
    }

    if (!location.href.match(appURL)) {
      return
    }

    if (!sessionStorage.getItem('_swa') && document.referrer.indexOf(appURL) !== 0) {
      const params = new URLSearchParams({
        referrer: document.referrer,
        screen: `${screen.width}x${screen.height}`,
        user: userID,
        utcoffset: '3'
      })

      fetch(`https://counter.dev/track?${params}`)
    }

    sessionStorage.setItem('_swa', '1')
  }
}
