Skip to main content

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, and none (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:
  1. Load — the SDK injects the Notifizz widget script (/v1/widget.js from widget.notifizz.com) into the page.
  2. Authenticate — the widget signs the user in based on your authType configuration.
  3. Ready — the widget signals it’s ready (notifizz:ready window event), and the isReady state flips to true.
  4. Active — the widget keeps the notification list current via real-time stream and emits notifizz:state events on every change.
  5. 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 the position option: Fine-tune placement with bellStyles and notificationCenterStyles:

State model

All SDKs expose the same NotifizzState object:

How to read state

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:
  • ReactrenderBell prop with a render function that receives NotifizzBellContext.
  • Angular — content projection via <ng-content> with the #customBellIcon template reference.
  • Vanilla JSsetBellElement(element) attaches click handling and keeps a data-unread attribute in sync.
See each SDK’s reference page for implementation details.

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

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.
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.
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.
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().
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.
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.