0.1.8 • Published 4 years ago

errtracker-lib v0.1.8

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

ErrTracker Library

Build Status Coverage Status

Usage scenarios

  1. Report to slack every error. Might create some slack distractions.
  2. Report first of its kind error only. Per device. Since the info about errors are kept in device's localstorage (if supported).
  3. Report every error and store it in AWS. Working on it.

Config

Slack details

Parameter nametype (default value)mandatorydescription
webHookUrlstringtrueslack webhook generated by slack
useConsoleLoggerboolean (false)falsefalsedetails you might need to provide
detailsobjectfalsedetails you might need to provide

AWS example

Parameter nametypemandatorydescription
apiKeystringtrueheader api key - granting access to api (generated on request, for now)
tokenstringtrueid to store error
useConsoleLoggerbooleanfalsereport about server side response, can provide custom logger
urlstringfalsewhere error was thrown
detailsobjectfalsedetails you might need to provide

Config samples

Slack every error report

  <script src="/path/to/errtracker-slack-lib.es5.js"></script>
  <script>
    (function(et, d, n) {
      if (!et) {
        return
      }

      et({
        webHookUrl: 'https://hooks.slack.com/services/some_unique_id',
        details: {
          platform: n.platform,
          userAgent: n.userAgent,
          url: d.location
        }
      });
    })(window['slackErrTracker'], window.document, window.navigator);
  </script>

Slack unique error report only example

<script src="/path/to/errtracker-unique-slack-lib.es5.js"></script>
<script>
  (function(et, d, n) {
    if (!et) {
      return
    }

    et({
      webHookUrl: 'https://hooks.slack.com/services/some_unique_id',
      details: {
        platform: n.platform,
        userAgent: n.userAgent,
        url: d.location
      }
    });
  })(window['uniqueSlackErrTracker'], window.document, window.navigator);
</script>

AWS example

<script src="/path/to/errtracker-lib.es5.js"></script>
<script>
(function(et, d, n) {
  if (!et) {
    return
  }
  et({
    // mandatory
    apiKey: 'xxxx-xxxx-xxxx',
    token: 'xxxxxx-xxxx-xx-xxx-xxxxxxxxx',
    // below are optional
    useConsoleLogger: true,
    url: d.location,
    details: {
      platform: n.platform,
      userAgent: n.userAgent
    }
  });
})(window['errtracker'], window.document, window.navigator);
</script>
0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2-m

5 years ago

0.1.2

5 years ago

0.1.3

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago