Skip to content

Instantly share code, notes, and snippets.

@BrandesEric
BrandesEric / index.html
Created November 30, 2016 15:41
Webpack Example
<html>
<head>
<script src="/dist/bundle.js">
</script>
</head>
</html>
@BrandesEric
BrandesEric / awesome.js
Last active June 19, 2018 12:47
TrackJS onError sending to third party API first, before tracking
let filename = ''
let jsonURL = 'https://api.myjson.com/bins'
let token = 'YOUR_TOKEN_HERE'
let trackJsCaptureUrl = `https://capture.trackjs.com/capture?token=${token}`
let actions = []
export function configureTracker () {
window.trackJs.configure({
onError: (payload, error) => {
@BrandesEric
BrandesEric / index-simple.js
Last active May 23, 2016 18:42
Webpack and TrackJS
// The easiest way to use TrackJS with webpack
// You can put the initial config in a different file if you wish, just make sure it's loaded before you require('trackjs')
window._trackJs = {
token: ""
}
require('trackjs'); // window.trackJs() will be a thing now in the browser.
// You can just treat as global if you wish:
trackJs.track("Test error");
@BrandesEric
BrandesEric / Test.html
Last active March 2, 2016 01:14
Nothing
<html>
<head>
<title>Error: It&#39;s just a flesh wound</title>
<meta name="author" content="TrackJS">
<meta name="description" content="Error: It&#39;s just a flesh wound" />
<meta property="og:description" content="http://localhost:3000/js/tracker-backup.js 41:116" />
<meta property="og:site_name" content="TrackJS" />
<meta property="og:title" content="Error: It&#39;s just a flesh wound" />
<meta property="og:url" content="https://local.trackjs.com:443/shared/MDczNzRkMmIwMTBjNDcyNzhmMWE2ZmY1OTA5ODMwMmM" />
<meta property="og:image" content="http://s3.amazonaws.com/uploads.hipchat.com/62739/433807/JoiUFgD4qldaTtK/favicon-196x196.png" />
@BrandesEric
BrandesEric / track.js
Created July 9, 2014 03:40
Meteor + TrackJS
// This thing lives at /client/lib/compatibility
(function (){
window._trackJs = {
token: "mytoken"
};
// the entire tracker script here
})()