Agent Installation
For NPM and Yarn
If you bundle the Atatus script with your source code, install theatatus-spa package using your preferred package manager.
Install atatus-spa from the registry:
main.ts):
For CDN
Alternatively, you can load the Atatus agent via CDN by adding the following snippet into the<head> section of your src/index.html file before any other script tags:
Test Integration
To verify that your integration is working properly, trigger a test error anywhere in your application:Track Exceptions in Angular Apps
Angular catches unhandled exceptions within its zone and delegates them to anErrorHandler class. To report these exceptions to Atatus, create a custom error handler.
1. Create a Custom Error Handler
Create anatatus.handler.ts file in your application directory:
2. Register the Error Handler
RegisterAtatusErrorHandler in your application configuration depending on the setup you are using:
Option A: Standalone Application (Angular 14+)
If your project uses standalone components and application bootstrap (bootstrapApplication), provide the custom error handler in app.config.ts:
Option B: NgModule Application (Classic Angular)
If your project uses@NgModule, register AtatusErrorHandler in the providers array of app.module.ts: