Skip to main content

Backend quickstart

This guide walks you through installing the Node.js SDK, tracking your first event, and sending a notification — all in under 5 minutes.
You will need your Auth Secret Key and SDK Secret Key from the Notifizz dashboard.

1. Install the SDK

npm install @notifizz/nodejs

2. Initialize the client

const { NotifizzClient } = require("@notifizz/nodejs");
// or ESM: import { NotifizzClient } from "@notifizz/nodejs";

const client = new NotifizzClient(
  "YOUR_AUTH_SECRET_KEY",
  "YOUR_SDK_SECRET_KEY"
);

3. Track your first event

Pick an event name that matches a workflow you’ve set up in the dashboard, and specify who should receive the notification:
await client
  .track({
    eventName: "user_signed_up",
    sdkSecretKey: "YOUR_SDK_SECRET_KEY",
    properties: {
      plan: "pro",
      source: "landing_page",
    },
  })
  .workflow("welcome_campaign", [
    { id: "user_1", email: "alice@example.com" },
  ]);
That’s it. The track() call fires the event, and the .workflow() call attaches a notification template and its recipients. The event is sent automatically after a short delay (1 second by default).

4. Generate an auth token (optional)

If your frontend uses backend token authentication, generate a token for each user:
const token = client.generateHashedToken("user_1");
// Return this token to your frontend

What just happened?

1

Event sent

The SDK sent an event named user_signed_up to the Notifizz API.
2

Workflow matched

Notifizz matched it to the welcome_campaign workflow.
3

Notification delivered

A notification was created and delivered in real time to user_1.
If the user has the frontend widget open, the notification appeared instantly. If not, it will be waiting when they next load the widget.

Next steps

Frontend quickstart

Set up the widget to display notifications in your app.

Node.js SDK reference

Explore the full API: configuration, direct send, and more.