xylabs/sdk-pixel-js

View on GitHub
src/getSystemInfo.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { parse } from 'bowser'

import { UserEventSystem } from './Api'

let systemInfo: UserEventSystem | undefined

export const getSystemInfo = () => {
  try {
    systemInfo = systemInfo || parse(window.navigator.userAgent)
  } catch (ex) {
    console.log(`getSystemInfo Error: ${ex}`)
  }
  return systemInfo
}