← Files BugfenderARCHIVED FILE
skills/bugfender-sdk-setup/references/angular.md
1.11 KB · Nov 30, 2026 · 07:41 UTC
# Angular
Use this reference after detecting an Angular app.
## Detect
Check:
- `angular.json`
- `src/app/app.module.ts`
- `src/main.ts`
Prefer `src/app/app.module.ts` as the Bugfender init location unless the repo already centralizes bootstrapping elsewhere.
## Minimum setup
Install:
```bash
npm i @bugfender/sdk
```
Initialize in `src/app/app.module.ts`:
```ts
import { Bugfender } from "@bugfender/sdk";
Bugfender.init({
appKey: "{APP_KEY}",
baseURL: "{BASE_URL}",
apiURL: "{SDK_API_URL}",
});
```
Only include `baseURL` and `apiURL` when custom non-default URLs are provided.
## Integration points
- dependency file: `package.json`
- bootstrap: `src/app/app.module.ts`
- optional crash wiring: custom Angular `ErrorHandler`
## Optional capabilities
- Crash reporting needs a custom Angular `ErrorHandler` that forwards errors with `Bugfender.sendCrash(...)`.
- Browser/UI logging should only be enabled if the chosen feature set includes them.
## Verification
After initialization, emit one test log from a known component constructor or startup path:
```ts
Bugfender.log("Bugfender initialized");
```
SHA-256: d7e5086270474575c7949ea3a5c6fe27cf90bb5c725636e202df1cd794998824