novu-manage-preferences
Original:🇺🇸 English
Translated
Configure notification preferences in Novu at the workflow and subscriber level. Set default channel preferences (email, SMS, push, chat, in-app), mark preferences as read-only or subscriber-editable, and manage subscriber-specific overrides. Use when setting up notification opt-in/opt-out, configuring per-channel delivery preferences, or building a preferences management UI.
15installs
Sourcenovuhq/skills
Added on
NPX Install
npx skill4agent add novuhq/skills novu-manage-preferencesTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Manage Preferences
Novu has a two-level preference system:
- Workflow defaults — configured in the dashboard for UI based workflows or via code in framework based workflows, apply to all subscribers.
- Subscriber overrides — set by end users, override workflow defaults
Workflow-Level Preferences
Set default preferences when defining a workflow with :
@novu/frameworktypescript
import { workflow } from "@novu/framework";
const alertWorkflow = workflow("system-alert", execute, {
preferences: {
all: { enabled: true, readOnly: false },
channels: {
email: { enabled: true },
sms: { enabled: false },
push: { enabled: true },
chat: { enabled: false },
inApp: { enabled: true },
},
},
});Authoring workflows in code? Seefor the full Framework setup, Bridge Endpoint, step controls, and deployment.framework-integration
Channel Types
| Channel | Description |
|---|---|
| Email notifications |
| SMS text messages |
| Mobile/web push notifications |
| Slack, Discord, Teams, etc. |
| In-app Inbox notifications |
Read-Only Preferences
Set to hide a workflow's channels from the Preferences UI — subscribers can't toggle them on or off:
readOnly: truetypescript
const criticalAlertWorkflow = workflow("critical-alert", execute, {
preferences: {
all: { enabled: true, readOnly: true }, // subscriber CANNOT disable
},
});readOnly
vs critical
— pick the right one
readOnlycriticalThese are different mechanisms with different guarantees. See for the full matrix.
design-workflow/references/severity-and-critical.md| Flag | What it does |
|---|---|
| UI only. Hides the workflow from the Preferences UI so subscribers can't toggle it. |
| Runtime. Bypasses subscriber preferences, skips digest, runs without delays. |
If you need the notification to always be delivered (account suspended, security alert, password reset), set — alone won't override existing subscriber overrides at runtime.
critical: truereadOnly: trueOptional (Subscriber-Editable) Preferences
typescript
const marketingWorkflow = workflow("weekly-newsletter", execute, {
preferences: {
all: { enabled: true, readOnly: false }, // subscriber CAN disable
channels: {
email: { enabled: true },
sms: { enabled: false }, // off by default, subscriber can enable
},
},
});Subscriber-Level Preferences
Subscribers can override workflow defaults (unless ).
readOnly: trueGet Subscriber Preferences
typescript
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: process.env.NOVU_SECRET_KEY,
});
const preferences = await novu.subscribers.preferences.list({
subscriberId: "subscriber-123",
});Update Subscriber Preferences
typescript
await novu.subscribers.preferences.update(
{
workflowId: "weekly-newsletter",
channels: {
email: false, // opt out of email
inApp: true, // keep in-app
},
},
"subscriber-123"
);Global Preferences
Update preferences across all workflows by omitting :
workflowIdtypescript
await novu.subscribers.preferences.update(
{
channels: {
sms: false, // disable SMS for all workflows
},
},
"subscriber-123"
);Preference Resolution Order
When Novu determines whether to deliver a notification:
- Subscriber workflow preference (most specific) — subscriber's override for this specific workflow
- Subscriber global preference — subscriber's default across all workflows
- Workflow default — developer-defined default in code
- System default — all channels enabled
The most specific preference wins. If a subscriber disables email for a specific workflow, that takes precedence even if their global email preference is enabled.
Preferences UI Component
React
tsx
import { Inbox } from "@novu/react";
function App() {
return (
<Inbox
applicationIdentifier="YOUR_NOVU_APP_ID"
subscriberId="subscriber-123"
subscriberHash="HMAC_HASH"
>
{/* The Preferences panel is built into the Inbox */}
</Inbox>
);
}The component includes a built-in Preferences panel accessible via the settings icon.
<Inbox />Standalone Preferences
Use the component independently:
<Preferences />tsx
import { Inbox, Preferences } from "@novu/react";
function PreferencesPage() {
return (
<Inbox
applicationIdentifier="YOUR_NOVU_APP_ID"
subscriberId="subscriber-123"
>
<Preferences />
</Inbox>
);
}Common Patterns
Critical Alerts (Always On)
typescript
preferences: {
all: { enabled: true, readOnly: true },
}Subscribers cannot opt out. Use for security alerts, payment notifications, legal notices.
Marketing (Opt-Out Friendly)
typescript
preferences: {
all: { enabled: true, readOnly: false },
channels: {
email: { enabled: true },
sms: { enabled: false },
},
}Subscribers can toggle channels. SMS is off by default.
In-App Only by Default
typescript
preferences: {
all: { enabled: false },
channels: {
inApp: { enabled: true },
},
}Only in-app is on. Subscribers can enable other channels if desired.
Common Pitfalls
- is per-workflow, not per-channel — you set
readOnly: trueon thereadOnlylevel. Individual channels inherit it.all - Subscriber overrides don't apply to workflows — if the workflow is read-only, subscriber preferences are ignored.
readOnly - in the workflow default means the channel is off — subscribers can still enable it (unless
enabled: false).readOnly: true - The Preferences UI only shows non-readOnly workflows — read-only workflows are hidden from the subscriber's preference panel.
- Global preferences apply across all non-readOnly workflows — they're a convenient "disable all email" setting, but workflow-specific preferences take precedence.
References
- Workflow Preferences Examples
- Subscriber Preferences Examples
- Preferences UI Examples