Ionic makes it easy to build interactive mobile apps using HTML5 and AngularJS. You need a powerful monitoring tool to identify and debug errors. Atatus integrates into Ionic with just a few lines of code.

Agent Installation

For NPM and YARN

If you want to include Atatus script with your source, you can add it through package managers such as YARN and NPM. Install atatus-spa from the npm or yarn registry:
Import and initialize atatus to monitor your application:

For CDN

Copy & paste this code into the <head> tag of your html (every page) to start using Atatus on your site. Please make sure that you add it before other script tags as well.
Replace the YOUR_API_KEY string with the API Key that is assigned for your project. You’re done. For more advanced options on installing your monitoring code, view customizing agent. Since Ionic framework is built on AngularJS framework, you have to follow Angular integration documentation.

Test Integration

To verify that your integration is working, call notify() in your application:
Within few seconds, performance metrics and errors will appear in your project dashboard.

Add atatus to the angular exception handler

Clean file URL in error stack trace

Many mobile applications being written in JavaScript within containers such as Apache Cordova, Ionic, PhoneGap etc.. So you may find that error stack traces contain file paths which are different across platforms and devices. Using onBeforeErrorSend method, you can rewrite file’s URLs before the error is reported back to Atatus. This will make the stack traces more easily readable.
Let us consider, an error occurring on the file path in Ionic framework
It will be reported to Atatus as follows

Using Source Maps

If you uploaded the source maps for JavaScript files, then you have to append corresponding domain name before the path. Let us say, you have uploaded a source map for a script file https://www.acme.com/www/js/app.min.js, then your code should look like
Let us say, an error is occurring on the file path in Ionic framework
It will be reported to Atatus as https://www.acme.com/www/js/app.min.js and the corresponding uploaded source map will be fetched and processed.