Skip to main content

Notification Center

The Notification Center is Notifizz’s in-app notification widget. It displays real-time notifications to your users as a bell icon with an unread badge and a dropdown list. All Notification Center SDKs (React, Angular, Vanilla JS) share the same underlying widget and expose the same capabilities through framework-idiomatic APIs. This page covers the concepts that apply across all of them.

Widget lifecycle

Every frontend SDK follows the same lifecycle:
  1. Load — The SDK injects the Notifizz widget script into the page.
  2. Authenticate — The widget authenticates the user based on your authType configuration.
  3. Ready — The widget signals it is ready to display notifications. The isReady state becomes true.
  4. Active — The widget listens for real-time updates and keeps the notification list current.
  5. Destroy (optional) — The widget is removed from the DOM and all listeners are cleaned up.
All SDKs expose a way to listen for the ready event and state changes so your app can react accordingly.

Positioning

Control where the bell icon appears using the position option:
ValueDescription
top-rightUpper-right corner of the viewport
top-leftUpper-left corner of the viewport
bottom-rightLower-right corner of the viewport
bottom-leftLower-left corner of the viewport
{
  position: "top-right"
}

Styling

Fine-tune the placement of the bell and the notification center with style options:

Bell styles

{
  bellStyles: {
    marginRight: "20px",
    marginLeft: "10px"
  }
}

Notification Center styles

{
  notificationCenterStyles: {
    marginTop: "50px"
  }
}
These style options let you nudge the widget to align with your app’s layout without writing custom CSS.

State model

All SDKs expose the same NotifizzState object:
PropertyTypeDescription
isReadybooleantrue once the widget has loaded and authenticated.
isOpenbooleantrue when the notification center dropdown is open.
unreadCountnumberThe current number of unread notifications.
lastUpdatednumberTimestamp (ms) of the last state change.
hasErrorboolean?true if the widget encountered an error.
errorCodestring?Error identifier, if applicable.

How to access state

const { unreadCount, isOpen, isReady } = useNotifizz();

Programmatic control

All SDKs let you open, close, and toggle the notification center programmatically:
MethodDescription
open()Opens the notification center
close()Closes the notification center
toggle()Toggles the notification center open or closed
This is useful for triggering the notification center from a custom button, a keyboard shortcut, or an in-app event.

Custom bell

Every SDK supports replacing the default bell icon with your own UI element. The approach varies by framework:
  • ReactrenderBell prop with a render function receiving NotifizzBellContext.
  • Angular — Content projection via ng-content with a #customBellIcon template reference.
  • Vanilla JSsetBellElement() method that attaches click handling and unread data attributes.
See each SDK’s reference page for implementation details.

Default URLs

The widget connects to these endpoints by default:
OptionDefault value
serverUrlhttps://widget.notifizz.com
apiUrlhttps://eu.api.notifizz.com/v1
widgetPath/v1/widget.js
You should not need to change these unless instructed by Notifizz support.

Authentication options

All frontend SDKs accept the same authentication fields:
OptionTypeRequiredDescription
apiKeystringYesYour Front API Key from the dashboard.
authType'firebase' | 'backendToken' | 'none'YesAuthentication strategy.
tokenstringFor firebase and backendTokenThe auth token.
userIdstringFor backendToken and noneThe user’s unique identifier.
userEmailstringFor backendToken and noneThe user’s email address.
See Authentication for a full guide on choosing the right strategy.

Next steps

React SDK

Full API reference

Angular SDK

Full API reference

Vanilla JS SDK

Full API reference