Welcome to TrackJS! Let’s get you started with the most commmon configuration options to get you back to fixing bugs.
Once you’ve created your account with TrackJS, you’ll need to install the agent in your website. You can do this by either referencing it from our CDN, or by taking a dependency on our npm package and bundling it into your application.
token is the only required option. You can find it on your Dashboard.
For more options on installing the agent, check the Installation page.
TrackJS Applications allow you to segment your error data by codebase or environment. Each codebase you want to protect should have it’s own application key, in addition to each deployed environment. This is done by creating application keys in the TrackJS Dashboard, and assigning them to the
application install option.
For example, let’s say your main web application is deployed to a “production” environment for real users, and a “test” environment for internal testing. You wouldn’t want noisy test data clouding your reports about production or setting off alerts. You would create 2 applications:
my-app-test. After creating the application keys, update your agent config with the
You may also want to protect other codebases with TrackJS, such as another application or your public website. You’ll want to create more applications for each of them to see which are having trouble. You would create additional applications:
Applications are a flexible way to segment your data and get more actionable reports. For more, checkout the Applications page.
TrackJS captures lots of context about the running browser, network, and application automatically. But your error reports become even better if you tell us more about your environment.
If you do not provide a
userId, we will generate one automatically based on the user’s IP Address and userAgent string.
You can get even more context by adding metadata about the current session. TrackJS metadata can be any property you find interesting about your environment, and give you the ability to filter by that property. For example, you could set the subscription level of the current user, what class of customer they belong to, or whether a feature has been enabled for them.
Metadata can be added at any time, before or after the agent has been installed. Each error has a “metadata” section where you can see the keys reported. You can also see all the metadata reported and filter by values in the Dashboard.
You may want to include context about the state of your application with error reports. The easiest way to do this is to log state changes to the
console.log. Every message written to the console will be included with TrackJS error reports.
Check out the Tips & Tricks for how to do this with your application.
The TrackJS agent automatically reports errors from several sources:
- A globally unhandled error from
- A unhandled Promise rejection
- An error thrown from a native callback function like
- A message written to
- A network request completed with a status of 400 or greater
Each of these can be configured with install options. You can also manually report an error using
TrackJS.track(). This is useful if you have an known interesting situation in your code you want to report on, or for testing out the integration.
We recommend that you generate Source Maps as a part of your build process, and make them available to us. If we can find a Source Map for your files, you’ll see your original source code when we process your Stack Traces, making it much easier to understand what was running.
For more information on setting up source maps, check out Minified Sources.
The TrackJS agent is tested and supported on the following browsers:
- Android Browser (4.0 and greater)
- Chrome (20 and greater)
- Edge (all versions)
- Firefox (4.0 and greater)
- Internet Explorer (8.0 and greater)1
- Mobile Safari (7.1 and greater)
- Opera (2013 and newer)
- Safari (5.0 and greater)
1 Internet Explore 8.0 does not support the capture of network errors.
- Integrating with Angular 2+ (Angular 1) - Better error messages for Angular
- Integrating with React/Redux - Application State context