Skip to content

Commit ce5a865

Browse files
committed
Update TrakerrClient
Update TrakerrClient to api v3, doc, and bugfixes.
1 parent 0c79945 commit ce5a865

File tree

4 files changed

+160
-41
lines changed

4 files changed

+160
-41
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ bower install https://github.com/trakerr-io/trakerr-javascript
3333
Install global handler
3434
```javascript
3535
var TrakerrClient = require('trakerr-javascript'); //This is only necessary for NPM use.
36-
var client = new TrakerrClient('<api-key>', '<app version here>', '<deployment stage here>'); // replace value within quotes with your values instead
36+
var client = new TrakerrClient('<api-key>', //Your API key
37+
'<app version here>', //Your app version
38+
'<deployment stage here>'); //Custom deployment stage of your code.
3739

3840
//any error thrown with throw new Error('...'); will now be sent to Trakerr
3941
client.handleExceptions(false);
@@ -46,7 +48,7 @@ Include the dependencies and initialize the global client variable with your API
4648
```html
4749
<script src="https://cdnjs.cloudflare.com/ajax/libs/superagent/3.5.2/superagent.min.js"></script>
4850
<script src="https://cdnjs.cloudflare.com/ajax/libs/stacktrace.js/1.3.1/stacktrace.min.js"></script>
49-
<script src="trakerr.min.js"></script>
51+
<script src="https://cdn.jsdelivr.net/gh/trakerr-com/trakerr-javascript@1.1.0/dist/trakerr.min.js"></script>
5052
<!-- initialize the client globally -->
5153
<script> trakerr = new TrakerrClient('<api-key>', '<version of your code>', '<deployment stage of codebase>'); </script>
5254
```
@@ -65,6 +67,8 @@ angular.module('your app').factory('$exceptionHandler', ['$window', function ($w
6567

6668
$window.trakerr.sendError(exception, "Error", function(error, data, response) {
6769
// ... handle or log response if needed ...
70+
71+
$log.error(exception, cause);//Relogs the error on the console
6872
});
6973
};
7074
}]);
@@ -73,14 +77,14 @@ angular.module('your app').factory('$exceptionHandler', ['$window', function ($w
7377
## Detailed Integration Guide
7478
This library works with both node apps and browser apps seamlessly.
7579

76-
For node apps just installing the above dependencies and bootstrapping the code similar to the below is sufficient. See the instructions below for the browser.
77-
7880
### Create a client
7981
In your script, the first thing before sending an event is to create a client. For npm apps, you may use require, but other options are also listed below.
8082

8183
```javascript
8284
var TrakerrClient = require('trakerr-javascript'); //This is only necessary for NPM use.
83-
var client = new TrakerrClient('<api-key>', '<app version here>', '<deployment stage here>'); // replace value within quotes with your values instead
85+
var client = new TrakerrClient('<api-key>', //Your API key
86+
'<app version here>', //Your app version
87+
'<deployment stage here>'); //Custom deployment stage of your code.
8488
```
8589

8690
### Option-1: Handle exceptions with a global handler
@@ -211,5 +215,5 @@ you can then use grunt to compile your own minified version of the code. The gru
211215
```bash
212216
grunt build
213217
```
214-
in the folder with gruntFile.js. If you wish to modify or fork our code, simply running `grunt build` in the folder after acquire the code.
218+
in the folder with gruntFile.js. If you wish to modify or fork our code, simply run `grunt build` after modifying the code to try it out in your browser locally.
215219

0 commit comments

Comments
 (0)