npm.io
1.0.2 • Published 3 months ago

@mushi-mushi/angular

Licence
MIT
Version
1.0.2
Deps
0
Vulns
0
Weekly
0
Stars
3

@mushi-mushi/angular

Your AI wrote it. Mushi tells you why it broke.

Angular SDK for Mushi Mushi bug reporting. API-only — captures errors and submits reports but does not include the widget UI. Add @mushi-mushi/web alongside this package for the full Shadow DOM widget experience.

One-command setup: npx mushi-mushi auto-detects Angular and installs this package + @mushi-mushi/web.

Other frameworks: @mushi-mushi/react · @mushi-mushi/vue · @mushi-mushi/svelte · @mushi-mushi/react-native · @mushi-mushi/capacitor · @mushi-mushi/web (vanilla JS)

Install

npm install @mushi-mushi/angular @mushi-mushi/web
# or: npx mushi-mushi

Environment variables

The wizard writes VITE_MUSHI_* for Angular CLI / Vite-based apps:

Variable Purpose
VITE_MUSHI_PROJECT_ID Project slug (proj_…) or UUID from Admin → Projects
VITE_MUSHI_API_KEY Ingest key (mushi_…)

See Project ID & API keys for format details.

Usage

import { provideMushi } from '@mushi-mushi/angular'

bootstrapApplication(AppComponent, {
  providers: [
    provideMushi({
      projectId: import.meta.env.VITE_MUSHI_PROJECT_ID,
      apiKey: import.meta.env.VITE_MUSHI_API_KEY,
    }),
  ],
})
With widget UI
import { provideMushi } from '@mushi-mushi/angular'
import { Mushi } from '@mushi-mushi/web'

bootstrapApplication(AppComponent, {
  providers: [
    provideMushi({
      projectId: import.meta.env.VITE_MUSHI_PROJECT_ID,
      apiKey: import.meta.env.VITE_MUSHI_API_KEY,
    }),
  ],
})

Mushi.init({
  projectId: import.meta.env.VITE_MUSHI_PROJECT_ID,
  apiKey: import.meta.env.VITE_MUSHI_API_KEY,
})

provideMushi() registers a global ErrorHandler and an injectable MushiService for programmatic reports.

API

Export Purpose
provideMushi(config) Standalone provider — init + global error handler
MushiService Injectable service for submitReport()

Peer dependencies

  • @angular/core >= 17

License

MIT

Keywords