Socket
Socket
Sign inDemoInstall

fe-error-tracker

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fe-error-tracker

A simple plugin to enable the window.onerror function to send details of runtime errors to a backend service.


Version published
Maintainers
1
Created

Readme

Source

Front End Error Tracker

A simple plugin to enable the window.onerror function to send details of runtime errors to a backend service.

Intercepted errors can be logged with another service.

Usage

npm i --save fe-error-tracker

--

// main.ts / main.js

import { feErrorTracker } from 'fe-error-tracker';

aFunctionThatIsCalledWhenYourAppInits = () => {
    const APP_NAME = 'example-app';                 // Unique identifier of the application
    const LOGGING_URL = 'http://mylogger.com';      // Url for sending logs to
    const DEBUG = false;                            // If set to true, will log requests before sending them

    feErrorTracker.init('Unique application name', 'Url to report errors to', true);
}

Tracking Items / Example Payload

{  
    "error": " Error to push, from window.onerror or manual error ",
    "currentUrl":" The Page URL of the client when the error occured ",
    "lineNumber": "Line number that the error was on ",
    "viewportHeight": "",
    "viewportWidth": "",
    "clientInfo":{  
        "language":"en-GB",
        "platform":"Linux x86_64",
        "userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
        "cookieEnabled": "true"
    }
}

Contribution

Build

This plugin is written in TypeScript, please make desired changes to files in the src folder and run npm build to compile the changes

Test

Tests are written with jest, use npm t to test.

FAQs

Last updated on 12 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc