Skip to main content

Inbox Security

HMAC Subscriber Hash

The subscriber hash prevents unauthorized access to notifications. Without it, anyone who knows a subscriber ID can read their notifications. HMAC is mandatory in production. The Novu API rejects unauthenticated Inbox requests in production environments.

How It Works

  1. Your server generates an HMAC-SHA256 hash of the subscriber ID using the NOVU_SECRET_KEY
  2. The hash is passed to the Inbox component as subscriberHash
  3. Novu verifies the hash server-side before returning notifications

Generate the Hash

Node.js

Python

Go

Pass to the Component

React

Vanilla JS

Security Checklist

  • Never expose NOVU_SECRET_KEY on the client — the hash must be generated server-side
  • applicationIdentifier is public — it can safely be in client-side code and environment variables
  • Generate the hash per subscriber — each subscriber gets a unique hash based on their ID
  • The hash is deterministic — same subscriber ID + same secret key always produces the same hash
  • Rotate the secret key carefully — changing the key invalidates all existing hashes
  • Use HTTPS in production — prevent the hash from being intercepted in transit