Set the correct environment
Novu supports multiple environments, including development, production, and any custom environments you create. When preparing for deployment, choose the environment that will serve as your production environment and update your configuration accordingly:- Use the API keys for your selected production environment from the API Keys page in your application.
-
Store keys in
.envfile or your server’s environment variables. -
Confirm your
applicationIdentifierandsubscribermatch the configuration for your chosen production environment. -
Add these two props, if using the EU region:
apiUrlwith value https://eu.api.novu.cosocketUrlwith value wss://eu.socket.novu.co
Secure your Inbox with HMAC encryption
When you add the Inbox to your application, you’re required to pass:subscriberId: Identifies the current subscriber.applicationIdentifier: A public key to communicate with the notification feed API.
subscriberHash) for each subscriberId. Novu verifies this hash to authenticate feed requests and to authorize updates to subscriber profile fields (firstName, email, locale, data, and so on) passed via the subscriber prop. Without subscriberHash, new subscribers are created with those fields, but existing profiles are not updated.
Follow these steps to enable HMAC encryption.
1. Enable HMAC in the dashboard
Activate the HMAC security feature within your Novu in-app provider settings.- Go to Novu Dashboard.
- Navigate to the Integrations Store page.
- Click on the Novu In-App for your chosen production environment
- A side panel opens from the right side of the screen with the provider settings, enable
Security HMAC encryptiontoggle in Integration Credentials section.
2. Generate HMAC hash on the server side
Next, use your secret key from the API Keys page on the Novu dashboard to generate an HMAC-SHA256 hash of thesubscriberId on the server side.
The hash is computed as HMAC-SHA256(secretKey, subscriberId) and returned as a lowercase hex string.
- Node.js
- Python
- Go
- PHP
- Ruby
- Java
- C#
utils/hmac-hash.ts
With context
If you use Inbox with context, also generate a hash for the context object. Context must be serialized as canonical JSON (RFC-8259) so key order and whitespace do not affect the hash.utils/hmac-hash.ts
3. Use the HMAC hash in the Inbox component
Send thehmacHash generated in the previous step to the client side application. You can include it in the initial data payload when a subscriber or user logs in or fetch it from a dedicated API endpoint.
Pass the hash to the subscriberHash prop in your Inbox component.
- Without Context
- With Context
components/InboxWithSubscriberHash.tsx
If HMAC encryption is active in In-App provider settings and
subscriberHash is not provided, the Inbox will not load. When passing a subscriber object, subscriberHash is also required to update an existing subscriber’s profile fields.Remove Novu branding
Users on a paid plan can remove the Novu branding from the Inbox UI and Emails.Novu branding appears on Inbox UI, emails and agents messages. It does not change the content of SMS, push, or chat messages.
- Go to the Novu Dashboard and open the Settings page directly, or click your organization name in the top-left of the sidebar to open it.
- Under the Organization tab, find the Branding & Integrations section.
- Enable the Remove Novu branding toggle.
