Skip to main content

Firebase Authentication

If your app already uses Firebase Auth, you can authenticate the Notification Center widget directly with a Firebase ID token. Notifizz verifies the token server-side — no additional backend work needed.

How it works

1

User authenticates with Firebase

Your app signs the user in using Firebase Auth (email/password, Google, GitHub, etc.).
2

Obtain the ID token

Firebase provides an ID token for the authenticated user.
3

Pass token to widget

Your frontend passes the Firebase ID token to the Notifizz widget.
4

Notifizz verifies

Notifizz verifies the token against Firebase to confirm the user’s identity. No backend code needed on your side.

Setup

Pass the Firebase ID token to the widget:
import { getAuth } from "firebase/auth";

const auth = getAuth();
const idToken = await auth.currentUser.getIdToken();

<NotifizzInbox
  options={{
    apiKey: "YOUR_FRONT_API_KEY",
    authType: "firebase",
    token: idToken,
  }}
/>

Required fields

FieldTypeDescription
authType"firebase"Must be set to "firebase".
tokenstringA valid Firebase ID token for the current user.
With Firebase authentication, you do not need to provide userId or userEmail — Notifizz extracts the user identity from the verified Firebase token.

Token refresh

Firebase ID tokens expire after 1 hour. Firebase SDKs handle automatic refresh, but you should ensure the widget receives a fresh token. If the widget loses its connection, re-initializing with a new token will restore it.
Use auth.currentUser.getIdToken() (without true) to get a cached token when valid, or a refreshed one when expired. Firebase handles this automatically.

When to use Firebase vs Backend Tokens

FirebaseBackend tokens
You already use Firebase AuthYes — zero extra workUnnecessary overhead
You have your own auth systemNot applicableUse this instead
Backend involvementNoneMust generate token per user
Token managementFirebase handles refreshYou manage token delivery

Next steps

Backend tokens

Alternative: authenticate with HMAC tokens from your backend.

Notification Center

Set up the widget to display notifications.