Loading...
Loading...
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.
npx skill4agent add novuhq/skills novu-manage-preferences@novu/frameworkimport { 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 | Description |
|---|---|
| Email notifications |
| SMS text messages |
| Mobile/web push notifications |
| Slack, Discord, Teams, etc. |
| In-app Inbox notifications |
readOnly: trueconst criticalAlertWorkflow = workflow("critical-alert", execute, {
preferences: {
all: { enabled: true, readOnly: true }, // subscriber CANNOT disable
},
});readOnlycriticaldesign-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. |
critical: truereadOnly: trueconst 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
},
},
});readOnly: trueimport { Novu } from "@novu/api";
const novu = new Novu({
secretKey: process.env.NOVU_SECRET_KEY,
});
const preferences = await novu.subscribers.preferences.list({
subscriberId: "subscriber-123",
});await novu.subscribers.preferences.update(
{
workflowId: "weekly-newsletter",
channels: {
email: false, // opt out of email
inApp: true, // keep in-app
},
},
"subscriber-123"
);workflowIdawait novu.subscribers.preferences.update(
{
channels: {
sms: false, // disable SMS for all workflows
},
},
"subscriber-123"
);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>
);
}<Inbox /><Preferences />import { Inbox, Preferences } from "@novu/react";
function PreferencesPage() {
return (
<Inbox
applicationIdentifier="YOUR_NOVU_APP_ID"
subscriberId="subscriber-123"
>
<Preferences />
</Inbox>
);
}preferences: {
all: { enabled: true, readOnly: true },
}preferences: {
all: { enabled: true, readOnly: false },
channels: {
email: { enabled: true },
sms: { enabled: false },
},
}preferences: {
all: { enabled: false },
channels: {
inApp: { enabled: true },
},
}readOnly: truereadOnlyallreadOnlyenabled: falsereadOnly: true