> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerix.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Angular — Installation

> Add Lerix to your Angular app in a few steps.

## Requirements

* Angular 19+

<Note>
  This is a dedicated Angular library — an injectable `LerixService`, a
  `provideLerix()` function for your `app.config.ts`, and an Angular
  `ErrorHandler` integration — built on top of `@lerix-dev/lerix-core`, the
  framework-agnostic engine shared by every Lerix web SDK. Building a React
  app instead? See the [React SDK](/frameworks/react/installation). If
  you're using neither Angular nor React, `@lerix-dev/lerix-core` also works directly.
</Note>

## 1. Add the dependency

```bash theme={"dark"}
npm install @lerix-dev/lerix-angular
```

## 2. Register the SDK

Add `provideLerix()` to your `app.config.ts`:

```ts app.config.ts theme={"dark"}
import { ApplicationConfig } from '@angular/core';
import { provideLerix } from '@lerix-dev/lerix-angular';

export const appConfig: ApplicationConfig = {
  providers: [
    provideLerix({
      apiKey: 'your-api-key',
      projectId: 'your-project-id',
      debugMode: true,
    }),
  ],
};
```

<Note>
  Find your API key and project ID in the [Lerix Dashboard](https://app.lerix.dev) under **Project Settings**.
</Note>

Registration with the backend, and the automatic crash handler, run at
bootstrap — before your app becomes interactive. There's no separate
`init()` call to make.

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | `string` | Yes | Your project API key from the dashboard |
| `projectId` | `string` | Yes | Your project ID (slug) from the dashboard |
| `url` | `string` | No | Backend base URL. Defaults to `https://api.lerix.dev/v1` — only change this if you're pointing at a self-hosted backend |
| `release` | `string` | No | The version this build ships as (e.g. `1.4.0` or a commit SHA). Pass the same value when uploading source maps so production stack traces show your original files: see [Source maps](/frameworks/angular/source-maps) |
| `debugMode` | `boolean` | No | Print SDK request/response logs to the console (default: `false`) |
| `enableCrashReporting` | `boolean` | No | Install the automatic error handler (default: `true`) — see [Error Tracking](/frameworks/angular/error-tracking) |
| `onError` | `(error: unknown) => void` | No | Called if initialization itself fails (e.g. network unreachable) |

## 3. Verify the integration

Inject `LerixService` and throw a test error to confirm everything is working:

```ts theme={"dark"}
import { Component, inject } from '@angular/core';
import { LerixService } from '@lerix-dev/lerix-angular';

@Component({ ... })
export class MyComponent {
  private readonly lerix = inject(LerixService);

  test() {
    this.lerix.throwError('Test error');
  }
}
```

Then open your [dashboard](https://app.lerix.dev) — the error should appear within seconds.

<Check>
  You're all set! Continue to [Error Tracking](/frameworks/angular/error-tracking) to report custom errors and enable automatic capture, or [Push Notifications](/frameworks/angular/push-notifications) to enable push delivery.
</Check>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.