How to use the @elastic/apm-rum-core.isPlatformSupported function in @elastic/apm-rum-core

To help you get started, we’ve selected a few @elastic/apm-rum-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / apm-agent-rum-js / packages / rum / src / bootstrap.js View on Github external
export default function bootstrap() {
  if (alreadyBootstrap) {
    return enabled
  }
  alreadyBootstrap = true

  if (isPlatformSupported()) {
    patchAll()
    enabled = true
  } else if (typeof window !== 'undefined') {
    /**
     * Print this error message only on the browser console
     * on unsupported browser versions
     */
    console.log('[Elastic APM] platform is not supported!')
  }

  return enabled
}