This is the Browser JavaScript client library for http://yellerapp.com. It lets you automatically detect errors in your application, and reports them via Yeller's API, so you can debug and fix them quickly.
Include yeller.js from our CDN in the <head>
tag of your site, before all other <script>
tags.
<script src="//js-yellerapp.a.ssl.fastly.net/yeller.js"></script>
Then immediately configure Yeller in another <script>
tag in your <head>
Yeller.configure({
token: 'YOUR_API_TOKEN_HERE'
});
That's it for basic configuration. There are a few more advanced settings later, but let's get you tracking errors first.
yeller.js
automatically tracks errors by default, but if you want to manually track one, you can do that like this:
try {
// your code here
} catch(error) {
Yeller.report(error);
}
Source maps let you see full stacktraces from your production errors, even for minified JavaScript (or languages that compile to JavaScript). They're extra important for your use of Yeller, because they mean your production errors get much less noisy, because Yeller's deduplication logic understands what's actually going on.
Yeller supports sourcemaps - it's pretty automatic.
All you have to do for Yeller's sourcemaps to work is:
http://example.com/my_js.min.js
and your sourcemap should go somewhere like this:
http://example.com/my_js.min.js.map
Yeller keeps track of which environment your application is running in, and segregates errors by environment. To set your environment, simply pass it in in your call to Yeller.configure
Yeller.configure({
token: 'YOUR_API_TOKEN_HERE',
environment: 'production'
});
Environments are simply strings. As a default, Yeller will ignore errors sent in the test
or development
environments.
yeller.js
also lets you attach additional data to your exception. The library already includes information about the page, the web browser and so on. As a note: this extra data (which is arbitrary JSON), should be under the key custom_data
.
try {
// your code here
} catch(error) {
Yeller.report(error, { custom_data: { user_id: user.id }});
}
You can also report the location
. location
lets you tell Yeller about the toplevel script, or routing handler, or component etc that is currently active when the exception is thrown.
try {
// your code here
} catch(error) {
Yeller.report(error, { location: 'MyApp.MyHandler.run', custom_data: { user_id: user.id }});
}
Attaching more debugging information gives you powerful diagnosis across all your exceptions.
If you have any questions, feel free to shoot me an email, .
If you're curious about this library, it's open source, and available on: github