Angular In development
The nabd-angular package: screen names from the Router, errors and slowness automatically.
Not available yet. These examples show the planned API; package and function names may change before the first release.
Install
npm install nabd-browser nabd-angularSetup
import { NabdOptions } from 'nabd-angular';
export const nabdOptions: NabdOptions = {
orgToken: 'nb_pub_…',
appName: 'My Portal',
environment: 'production',
consentRequired: true,
};standalone (from Angular 15)
import { provideNabd } from 'nabd-angular';
bootstrapApplication(AppComponent, {
providers: [
provideRouter(routes),
provideHttpClient(),
provideNabd(nabdOptions),
],
});NgModule (from Angular 13)
import { provideNabd } from 'nabd-angular';
@NgModule({
imports: [BrowserModule, HttpClientModule, RouterModule.forRoot(routes)],
providers: [provideNabd(nabdOptions)],
bootstrap: [AppComponent],
})
export class AppModule {}provideNabd calls Nabd.init itself. No interceptor needed: HttpClient requests are measured directly in the browser.
Consent
import { Nabd } from 'nabd-browser';
accept(): void {
Nabd.setConsent(true);
}Screen names
The name is the route pattern (invoices/:id/edit), so there are no numbers or identifiers, and it works with useHash. For a custom name:
{ path: 'invoices/new', component: InvoiceCreateComponent,
data: { nabdScreen: 'invoice_create' } }Events
Nabd.trackEvent('taskCompleted', { screen: 'invoice_create' });
Nabd.setUserRef(userRefFromServer); // after sign-in, without the token itselfErrors
Errors that reach the ErrorHandler are recorded (type and fingerprint only), and your custom handler keeps working. HttpErrorResponse is not counted twice: the network failure is already recorded by measuring the request.
The package reads no headers, request bodies or full URLs. For the rest of the API, options and tap detection limits see the JavaScript page.