Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 12 additions & 180 deletions content/docs/platform/concepts/subscribers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,192 +10,24 @@ In Novu, a subscriber represents a user or system entity that is intended to rec

## How Novu identifies a subscriber

Each subscriber is uniquely identified in Novu by a `subscriberId`. This ID is defined by your application and serves as the reference point for all subscriber-related operations whether sending messages, retrieving preferences, or managing user data.
Each subscriber is uniquely identified in Novu by a `subscriberId`. This ID is defined by your application and serves as the reference point for all subscriber-related operations, including triggering workflows, applying preferences, and managing notification history.

Unlike email addresses or phone numbers, which may change or be shared across users, the `subscriberId` must remain stable and unique within your system. It acts as the anchor that connects a subscriber’s profile, activity history, and delivery settings across all channels and workflows.

<Callout>Use your application's internal user ID as the `subscriberId` to ensure consistency across your systems.</Callout>
Unlike attributes such as email addresses or phone numbers, which can be updated or be duplicated across users, the `subscriberId` must remain stable and unique within your system. It acts as the anchor that connects a subscriber’s identity to their profile, preferences, and all notification activity.

## Subscriber metadata and profile structure
## Why subscribers matter

A subscriber’s profile holds all relevant data Novu uses to personalize, deliver, and manage notifications. These fields can power dynamic content in your templates, define conditional logic in workflows, and control which channels a subscriber can receive notifications through.
Subscribers form the basis of targeted and personalized notifications in Novu. They allow you to:

All metadata tied to a subscriber is centralized and accessible via API or dashboard. This structure ensures that when notifications are triggered, Novu references the most up-to-date context for delivery and personalization.
- Distinguish between different recipients even if they share the same contact details
- Track individual delivery history, preferences, and notification state
- Manage how messages are routed across channels like email, SMS, in-app through the Inbox component, push, or chat
- Support multi-tenant systems or platform users where entity IDs must be scoped to the source system

These data includes:
At a high level, subscribers enable Novu to deliver the right message to the right person, in the right way regardless of how your system models users or customers.

### User data
## Subscriber roles in workflows

Data stored in the subscriber object that you can easily access in your notification templates. This contains basic info such as `email`, `phone`, `firstName`, `locale` and others. This data is fixed and structured.
When a workflow is triggered, subscribers act as the target audience. All personalization, message delivery, and channel decisions are applied per subscriber.

### Custom data

Apart from the above fixed structured user data, any unstructured custom data such as user's `address`, `membershipLevel`, `preferredTopics`, or `companySize` can also be stored in the `data` field using key-value pairs.

### Channel specific credentials

To deliver messages through push or chat-based channels, Novu also supports storing delivery credentials on the subscriber profile:
- `deviceTokens`: Used to target mobile devices via push notifications.
- `webhookUrl`: Used by chat providers such as, Slack, Discord to reach the subscriber.

These fields ensure Novu can deliver messages reliably to all supported destinations, even when the channel requires platform-specific configuration.

Learn more about subscriber attributes and schema in the [Subscribers API](/api-reference/subscribers/subscriber-schema).


## Subscriber creation in Novu

Before you can send notifications, a subscriber must exist in Novu. Asides from manually creating a subscriber via the Novu dashboard, Novu supports multiple approaches to subscriber creation depending on your application’s architecture and user lifecycle.

### Just in time

Novu allows you to create a subscriber automatically at the moment a notification is triggered. If the subscriber doesn't already exist, Novu uses the information provided in the workflow trigger to create the subscriber on the fly. If the subscriber exists, Novu updates the stored data with the latest values.

This approach is useful when:
- Your system does not store subscriber profiles ahead of time.
- Notifications are sent during real-time events like sign-ups or transactions.
- You want to keep the creation and delivery logic tightly coupled.


<Tabs items={['Node.js']}>
<Tab value="Node.js">
```typescript
import { Novu } from "@novu/api";

const novu = new Novu({ secretKey: "<YOUR_SECRET_KEY_HERE>", });

await novu.trigger({
to: {
subscriberId: "subscriber_unique_identifier",
firstName: "Albert",
lastName: "Einstein",
email: "[email protected]",
phone: "+1234567890",
},
workflowId: "workflow_identifier",
});
```
</Tab>
</Tabs>

### Ahead of trigger

Alternatively, you can create and store subscriber profiles ahead of time — typically during onboarding, registration, or data sync events. This approach allows you to manage subscriber preferences, enrich profiles, and inspect delivery readiness before any notification is triggered.

This is recommended when:
- You want to decouple user creation from notification logic.
- You rely on persistent user data or prefer strict validation before delivery.
- You plan to use advanced segmentation or preference-based delivery.

### Bulk Import

For scenarios like data migration, syncing large lists, or preloading subscribers, Novu supports bulk creation. This is especially useful when integrating with existing systems or importing subscriber data from external sources.

## Where to manage subscriber data

Subscriber data in Novu can be managed from the Novu dashboard or using the [Subscribers API](/api-reference/subscribers/subscriber-schema). Both offer full access to view, update, and organize subscriber profiles, but they serve different use cases depending on your requirements.

### Dashboard

The Novu dashboard provides a visual interface for exploring and editing subscriber data. It’s useful for:

- Searching and filtering subscribers by ID, email, phone and name.
- Inspecting user profiles, including structured fields, custom data, topic subscriptions and channel preferences.
- Performing manual updates or troubleshooting delivery issues

This is ideal for non technical team members responsible for managing subscribers or teams that want to audit or manage subscriber data without relying on code.

### API

For programmatic control, the Novu API offers endpoints to create, update, delete, and retrieve subscriber records at scale. It supports:

- Automated onboarding or sync processes
- Bulk operations such as imports or exports
- Integration with external systems like CRMs or identity platforms

Use the API when managing subscribers is part of your backend workflows or when changes need to happen dynamically based on user actions.

## Subscriber preferences and personalization

Novu allows each subscriber to define how they want to receive notifications. These preferences influence both the delivery channels and the types of messages a subscriber will receive.

### Global preferences

Subscribers can configure preferences that apply across all workflows. These include:

- Opting in or out of specific channels, for example, email, SMS, push, or in-app
- Disabling notifications altogether

These global settings act as a default and are respected unless explicitly overridden in specific workflows.

### Subscriber workflow specific preferences

In some cases, a subscriber may want to receive certain notifications but only through specific channels. Novu supports fine-grained overrides at the workflow level. This allows you to:

- Adjust channel preferences per notification type
- Honor granular user choices while maintaining global defaults

### Template personalization

Subscriber data, both structured fields such as `firstName`, `email` and custom data can be used to personalize templates. This enables dynamic content such as:

- Greeting users by name
- Including location-based content
- Adjusting language or tone based on locale or membership level

Subscriber preferences and metadata personalization ensure that each subscriber receives relevant, well-targeted messages through the channels they care about.

### Subscriber API reference
<Cards>
<Card
title="Create a subscriber API"
href="/api-reference/subscribers/create-subscriber"
description="Create a new subscriber in Novu"
/>
<Card
title="Update a subscriber API"
href="/api-reference/subscribers/update-subscriber"
description="Update subscriber attributes for an existing subscriber"
/>
<Card
title="Bulk create subscribers API"
href="/api-reference/subscribers/bulk-create-subscribers"
description="Create bulk subscribers in Novu to migrate large number of users"
/>
<Card
title="Retrieve subscriber subscriptions API"
href="/api-reference/subscribers/retrieve-subscriber-subscriptions"
description="Retrieve all topics a subscriber is subscribed to"
/>
<Card
title="Update subscriber credentials API"
href="/api-reference/subscribers/update-subscriber-credentials"
description="Update chat and push channel credentials for a single subscriber"
/>
<Card
title="Update subscriber preferences API"
href="/api-reference/subscribers/update-subscriber-preferences"
description="Update channel preferences for a single subscriber"
/>
</Cards>

## Frequently asked questions
These are some of the most frequently asked questions about subscribers in Novu.
### Can two subscribers have the same email address?

Yes, two subscribers can have the same email address, phone number, or any other attributes. However, each subscriber must have a unique subscriberId.

### Do I have to use subscriberId as same as the system userId?

No, you don't need to use the same subscriberId as the system userId. You can use any unique ID as subscriberId. Novu recommends using userId as subscriberId to avoid any confusion. Some of our customers use a pattern like `auth0|userId` as a value for `subscriberId`.

### Can a notification be sent without adding a subscriber?

No, a notification cannot be sent without adding a subscriber. A subscriber is an entity to which notification messages are sent. You must add a subscriber to Novu before triggering the workflow.

### How do I migrate millions of users to Novu?

To migrate millions of users to Novu, use the [Bulk Create Subscribers](/api-reference/subscribers/bulk-create-subscribers) API endpoint. This endpoint allows you to create multiple subscribers in bulk.

### Can subscriber credentials for chat and push channels be added when creating a new subscriber?
Subscriber credentials for Push and Chat channel providers can be added while creating a new subscriber using the `channels` field in the [create subscriber](/api-reference/subscribers/create-subscriber) request payload.
Even in workflows that send the same notification type, for example “Order confirmed”, each subscriber may receive a different version of the message based on their data, channel configuration, and preferences. This per-subscriber execution ensures flexibility and relevance at scale.