Notification Center widget
The Notification Center is Notifizz’s in-app notification widget — a bell icon with an unread badge and a dropdown list of notifications. It ships in three SDKs (React, Angular, Vanilla JS) that all wrap the same underlying widget and expose the same capabilities through framework-idiomatic APIs.TL;DR
- One widget, three SDKs. Pick the package that matches your frontend stack —
@notifizz/react,@notifizz/angular, or@notifizz/vanilla. The wire format and capabilities are identical. - Real-time by default. New messages stream into the widget as they are created — no SSE, no polling.
- Three auth modes.
firebase,backendToken, andnone(dev-only). A fourth,PubliclySignedJwt, is configured server-side via the dashboard. - Programmatic control. Every SDK exposes
open(),close(),toggle(), and a state observable so you can drive the widget from outside its default bell. - Custom bell — replace the default UI with your own component while Notifizz keeps managing data.
Widget lifecycle
Every SDK follows the same lifecycle:- Load — the SDK injects the Notifizz widget script (
/v1/widget.jsfromwidget.notifizz.com) into the page. - Authenticate — the widget signs the user in based on your
authTypeconfiguration. - Ready — the widget signals it’s ready (
notifizz:readywindow event), and theisReadystate flips totrue. - Active — the widget keeps the notification list current via real-time stream and emits
notifizz:stateevents on every change. - Destroy (optional) — the widget is removed from the DOM and all listeners are cleaned up.
The widget holds a real-time connection scoped to the signed-in user, and new messages land in the inbox as they are created. The dashboard activity log uses SSE for a different purpose — don’t confuse the two.
Positioning and styling
Control where the bell appears with theposition option:
Fine-tune placement with
bellStyles and notificationCenterStyles:
State model
All SDKs expose the sameNotifizzState object:
How to read state
- React
- Angular
- Vanilla JS
Programmatic control
All SDKs let you drive the widget from outside its default bell:
Use this to trigger the panel from a header button, a keyboard shortcut, or an in-app event.
Custom bell
Every SDK supports replacing the default bell with your own UI element:- React —
renderBellprop with a render function that receivesNotifizzBellContext. - Angular — content projection via
<ng-content>with the#customBellIcontemplate reference. - Vanilla JS —
setBellElement(element)attaches click handling and keeps adata-unreadattribute in sync.
Default URLs
You should not need to change these unless instructed by Notifizz support — for staging or regional endpoints, override per environment.
Authentication options
All frontend SDKs accept the same authentication fields:
A fourth auth mode,
PubliclySignedJwt, is configured server-side via the dashboard notificationCenterSetup implementation-task and reaches the widget without an SDK shorthand. See authentication overview for the full picture.
FAQ
Which SDK should I pick?
Which SDK should I pick?
The one that matches your frontend stack:
@notifizz/react for React, @notifizz/angular for Angular standalone components, @notifizz/vanilla for any other setup (plain JS, Vue, Svelte, server-rendered pages with islands, …). They wrap the same widget — the only differences are framework idioms.The widget loads but the bell stays empty (`isReady: true`, `unreadCount: 0`).
The widget loads but the bell stays empty (`isReady: true`, `unreadCount: 0`).
Three things to check in order: (1)
userId matches the recipient identifier the campaign emits — most “empty bell” cases are auth working but userId mismatch; (2) the campaign actually fired (look at delivery history in the dashboard); (3) the user has an existing inbox recordument — first-ever load lazily creates it, so emit one event before opening the widget.`isReady` never flips to `true`.
`isReady` never flips to `true`.
Auth failed. Check the browser console — the widget logs the auth error. Common causes: stale
token (regenerate from your backend), wrong authType (e.g. passing a Firebase token in backendToken mode), or expired Front API Key. Inspect state.hasError / state.errorCode for a typed signal.Can I read unread count without rendering the default bell?
Can I read unread count without rendering the default bell?
Yes — that’s the headless mode. In React, wrap your tree in
NotifizzProvider and call useNotifizz() from anywhere. In Angular, inject NotifizzService and subscribe to state$. In Vanilla, call createNotifizz(...), then mount() or setBellElement() and read getState() / subscribe via onStateChange().What happens if I call `open()` before `notifizz:ready`?
What happens if I call `open()` before `notifizz:ready`?
The command is dropped silently. Always wait for
state.isReady === true before driving the widget programmatically. The React/Angular/Vanilla APIs already guard against this — the bell context exposes isReady precisely so your UI can stay disabled until the widget is live.Multiple users on the same browser — how do I switch?
Multiple users on the same browser — how do I switch?
Call
destroy() on the current instance, then mount a new one with the new userId + token. The widget caches real-time state per session — without a clean destroy, the new mount will briefly show the previous user’s notifications.See also
React SDK
Full API reference for
@notifizz/react.Angular SDK
Full API reference for
@notifizz/angular.Vanilla JS SDK
Full API reference for
@notifizz/vanilla.Authentication overview
Pick the right widget auth mode.