@notifizz/angular SDK reference
@notifizz/angular ships a standalone Angular component (<notifizz-bell>) and an injectable NotifizzService exposing the widget state as an RxJS observable. Use it from any Angular 17+ app.
TL;DR
<notifizz-bell [options]="..." />— drop-in standalone component that renders the bell + dropdown.NotifizzService— inject anywhere for programmatic control (open(),close(),toggle(),state$).- Three auth modes via
authType:'firebase','backendToken','none'(dev-only). - Replace the default bell with content projection (
#customBellIcon) — works with any Angular template or component. - Web push opt-in is headless:
notifizz.webpushOptIn()plus the reactivewebpushStatus$let you own the button.
Installation
NotifizzAngularComponent
A standalone component that renders the bell icon and the notification center. Use the notifizz-bell selector in your template.
Basic usage
Inputs
Outputs
Reactive state
The component exposes astate$ observable:
NotifizzOptions
authType: "none" example (dev only)
Custom bell icon
Replace the default bell using Angular content projection. Use the#customBellIcon template reference:
#customBellIcon reference.
NotifizzService
An injectable service for programmatic control of the widget from anywhere in your application — outside the template.
Properties
Methods
Programmatic initialisation
Skip the component and drive the widget purely via the service:Web push opt-in
The opt-in is headless: no bell required, no Notifizz UI. You own the button and its timing, andwebpushStatus$ tells you when to show it.
Call
webpushOptIn() from a real click. A permission request that isn’t tied to a user gesture is ignored by the browser, and some browsers penalise the site for asking. Full channel behaviour is in web push.
Internal services
These services are used internally by
NotifizzService. You typically don’t need them unless you’re building advanced integrations or custom state management.NotifizzStateService
Manages the internal state. Useful if you need fine-grained control over state updates.
NotifizzCommandService
Sends commands to the widget. Used internally by NotifizzService.
State shape
NotifizzState (delivered through state$, onStateChange, the stateChange output):
Exported types
FAQ
Does this work with Angular's NgModule-based app structure?
Does this work with Angular's NgModule-based app structure?
NotifizzAngularComponent is standalone but importable into any module via imports: [NotifizzAngularComponent]. The same applies if you migrate part of an existing NgModule app to standalone. The NotifizzService is provided in 'root' and works in both setups.Server-side rendering — what happens?
Server-side rendering — what happens?
The widget is browser-only. On the server,
NotifizzAngularComponent renders an empty mount <div> and the service no-ops. Hydration on the client triggers script loading and authentication. SSR works without extra config.Multiple components show different states.
Multiple components show different states.
They shouldn’t —
NotifizzService is provided in 'root', so every injection sees the same state$ BehaviorSubject. If you see drift, you have probably re-provided the service at the component level (providers: [NotifizzService]), creating a separate instance. Remove the local provider.`stateChange` fires before `ready`. Is that expected?
`stateChange` fires before `ready`. Is that expected?
Yes. The widget can publish a state update for the cached
getState result before the ready event fires (e.g. unreadCount from the previous session). Always gate UI on state.isReady === true if you need post-auth state.How do I switch user without recreating the component?
How do I switch user without recreating the component?
Update
notifizzOptions.userId / notifizzOptions.token and call notifizz.destroy() then notifizz.init(...) from the service. The component does not currently re-authenticate on [options] change in place — destroy + re-init is the safe path.Custom bell click does not toggle the dropdown.
Custom bell click does not toggle the dropdown.
Make sure the projected element has the
#customBellIcon template reference variable. The component listens for clicks on the element matching that reference; without it, your icon renders but the click handler never wires up.See also
Notification Center overview
Lifecycle, state model, positioning, custom bell.
Authentication overview
Pick the right widget auth mode.
Frontend quickstart
Get the widget rendering in under five minutes.
Backend quickstart
Send the events the widget will display.