--- ## NotificationListener Headless SSE listener for real-time notifications. Reconnects with exponential backoff (1–30s). Connects to `basePath` (default `/api/notifications/stream`). Pair with `createStreamHandler(sse)` on the server — mount its `GET` on the stream route. **Import:** `import { NotificationListener } from '@urbicon-ui/auth';` ### Examples ```svelte store.add(n)} /> ``` ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | basePath | `string` | no | '/api/notifications/stream' | SSE stream endpoint. Read once when the component mounts — to switch endpoints (e.g. after a user change), unmount and remount the listener. | | maxReconnectAttempts | `number` | no | 5 | Maximum reconnection attempts before giving up. Read once at mount. | | onError | `(error: Event) => void` | no | | Called when the SSE connection encounters an error. | | onNotification | `( notification: import('../../../server/adapters/types.js').NotificationRecord ) => void` | no | | Called when a new notification arrives via SSE. | | onReconnect | `(attempt: number) => void` | no | | Called when a reconnection attempt starts. Receives current attempt number. |