Configuration
setTabConfig
- Using this config, you can customize the name of the tabs or disable them altogether.
- By default, all the three tabs are enabled.
- React / Next.js with Hooks
- React / Next.js
- Other Frameworks
You can set it on Notifications Tool:You can alternatively set it on Notifications Panel if you have directly embedded it:Using APIs:
considerAllNotifications
Controls the notification count and unread indicator for the notification panel. When enabled, the notification count and unread badge include items from all tabs; when disabled (default), they only include items from the “For You” tab. Default:false
- React / Next.js
- Other Frameworks
Using Props:
enableCurrentDocumentOnly
Programmatically filters notifications to show only those from the current document. By default it shows notifications for the 15 most recently active documents accessible to the current user in the current organization.- React / Next.js
- Other Frameworks
Hooks:API:
setMaxDays
Notifications older than the specified number of days will not be displayed. Default: 15 days.- React / Next.js with Hooks
- React / Next.js
- Other Frameworks
panelOpenMode
Notifications Panel opens in one of the following ways:popover: It opens as a popover on the Notification Tool.sidebar: It opens as a sidebar from the right edge of the screen.
popover.
- React / Next.js
- Other Frameworks
pageSize
Control initial notification load count.- React / Next.js
- Other Frameworks
enableReadNotificationsOnForYouTab
- You can control whether read notifications are displayed in the “For You” tab. By default, read notifications are removed from this tab.
- This feature allows you to customize the visibility of read notifications in the “For You” tab, providing more flexibility in how notifications are displayed to users.
false.
- React / Next.js with Hooks
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
enableCrossOrganization
- When enabled, notifications from docs user has access to in other organizations are merged into the “For You” tab.
- Only the “For You” feed is supported.
- The
enableCrossOrganizationprop accepts aboolean, aCrossOrganizationConfigobject, or a JSON config string; theenable-cross-organizationattribute accepts"true"/"false"or a JSON config string.
false.
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
CrossOrganizationConfig fields: See CrossOrganizationConfig for the full type definition.
Passing
{ enabled: false } as the config to enableCrossOrganization() routes to disable. Passing null or calling without arguments opts in with all defaults.getCrossOrganizationConfig
Retrieve the current cross-organization configuration. UsegetCrossOrganizationConfig$() to subscribe to ongoing changes.
- React / Next.js with Hooks
- React / Next.js
- Other Frameworks
enableUserScopedNotifications
- By default, the “For You” tab and the unread count are derived from the organization’s 15 most recently active documents. An unread notification whose document falls outside that window is not fetched, so it disappears from the tab and the count until the document becomes active again.
- When enabled, the SDK also fetches the signed-in user’s newest notifications for the current organization directly, independent of that window. Those notifications are merged into the “For You” store, deduped by
notificationId, and merged additively into the “All” tab. - The
enableUserScopedNotificationsprop accepts aboolean, aUserScopedNotificationsConfigobject, or a JSON config string; theenable-user-scoped-notificationsattribute accepts"true"/"false"or a JSON config string.
false.
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
UserScopedNotificationsConfig fields: See UserScopedNotificationsConfig for the full type definition.
Behavior:
- Setting the prop and calling the API method write to the same setting, so the last write wins. Drive it from one place only, and note that setting it on either
VeltNotificationsToolorVeltNotificationsPanelis equivalent. - Calling
enableUserScopedNotifications()before initialization orsetDocument()is safe. The setting latches and takes effect on the first full fetch after the organization pipeline initializes. - The user-scoped fetch runs on full fetches only, and is suppressed under
currentDocumentOnly. Narrowing the scope explicitly wins over this setting. - Switching organization or document clears the stores as before, and the next full fetch re-sends the setting, so user-scoped notifications never carry across organizations.
- In the “For You” store, a notification that arrives through both the per-document path and the user-scoped path appears once. In the “All” tab, document notifications win on ID collision and user-scoped notifications outrank cross-organization ones; the result is sorted by timestamp descending.
- Cross-organization “For You” behavior and the
maxNotificationDaysretention bound are unchanged. - The fetch requires matching backend support. Against an older backend it falls back to the windowed behavior instead of failing.
Passing
{ enabled: false } as the config to enableUserScopedNotifications() routes to disable and keeps the previously configured limit. Passing null or calling without arguments opts in with all defaults.The first load after opting in at a busy organization surfaces previously invisible unread notifications in one batch. This is the intended correction. The unread count is capped at the configured
limit.disableUserScopedNotifications
Turn the user-scoped fetch back off. The “For You” tab and the unread count return to the recently-active-documents window with no other change.- React / Next.js
- Other Frameworks
enableSelfNotifications
- By default notifications api and components exclude notifications where the current user is the action user.
- This feature allows you to enable self notifications.
false.
- React / Next.js
- Other Frameworks
Using props:Using API:
Data
getNotificationsData
- Get the notifications data for the current user.
- Velt returns a notification for a private comment only to users who can see that comment. Learn more →
- The returned data includes notifications from up to the number of days specified by max days configuration.
- “For You” tab: By default only the latest 50 notifications are fetched. This is done to reduce clutter and noise.
- “Document” and “All” tabs: By default, up to 15 notifications are fetched for each of the 15 most recently active documents accessible to the current user. This highlights the most relevant and recent activity.
-
Params:
- query: Optional.
GetNotificationsDataQuerytype: Filter for notification type: all, for you, or documents.forYou: returns notifications where the current user is involved.all/documents: returns all notifications from the documents the user has access to.
- query: Optional.
-
Returns
Notification[]
- React / Next.js
- Other Frameworks
Using Hooks:Using API:To unsubscribe from the subscription:
getUnreadNotificationsCount
- Retrieve the count of unread notifications, which includes a breakdown for different tabs.
- The ‘Document’ tab is not included in the response because it contains all the notifications present in the ‘All’ tab.
- React / Next.js
- Other Frameworks
Using Hooks:Using API:
Event Subscription
on
- Subscribe to Notification Events. Here is the list of events you can subscribe to and the event objects you will receive.
- React / Next.js
- Other Frameworks
onNotificationClick
- The
onNotificationClickevent fires when a notification is clicked in the Notifications Panel. - It returns a
Notificationobject with details about the clicked notification. - Listen to this event via either the Notification Tool or the Notification Panel, but not both.
- Use this event to implement custom actions in response to notification clicks, such as navigating to a specific part of the app.
- React / Next.js
- Other Frameworks
Actions
markNotificationAsReadById
- Mark a single notification as read using its notificationId.
- The notification will be marked as read in all tabs.
- React / Next.js
- Other Frameworks
openNotificationsPanel
- Programmatically open or close the notification panel using the provided APIs.
- This will not work if you have embedded the notification panel in your app.
- React / Next.js
- Other Frameworks
setAllNotificationsAsRead
- Mark all notifications as read, either globally or for a specific tab.
- Using ‘all’ or ‘document’ as the
tabIdmarks all notifications as read across all tabs (equivalent to callingsetAllNotificationsAsRead()without arguments). - Using ‘for-you’ as the
tabIdonly marks notifications in the ‘for-you’ tab as read.
- React / Next.js
- Other Frameworks
Notification Settings
enableSettings
- Enable or disable the settings feature for notifications. This allows users to configure their notification preferences.
- Params:
none - Returns:
void
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
enableSettingsAtOrganizationLevel
Enable organization-level notification settings. When enabled, settings apply to all documents in the organization instead of per-document. Params:none
Returns: void
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
settingsLayout
Control how notification settings are displayed. Two layout modes are available. Default:accordion
Type: NotificationSettingsLayout
Options:
accordion: Settings displayed in expandable accordiondropdown: Settings displayed in dropdown menu
- React / Next.js
- Other Frameworks
setSettingsInitialConfig
- Set the initial default configuration for notification settings. This defines the available settings options and their default values.
- By default we have config added for inbox (in-app notifications) and email.
- You can extend this to add more channels where you intend to send notifications to your users. eg: slack, jira, asana, linear etc.
- If you do extend it to other custom channels, you will need to send the data to those channels yourself using our webhooks. Learn more
- This config will automatically generate the settings UI for the user to configure their notification preferences.
- Params:
NotificationInitialSettingsConfig[]- Here is what the value types mean:
ALL: Subscribes the user to all notifications whether or not the user is involved in the notification on the current document.MINE: Subscribes the user to notifications that are related to the current user on the current document.NONE: Subscribes the user to no notifications on this channel on the current document.
- Here is what the value types mean:
- Returns:
void
- React / Next.js
- Other Frameworks
Using Hook:Using API:
muteAllNotifications
- Mutes all notifications across all the channels for the current user in this current document.
- In case of multiple documents or folders, this will mute all notifications for the user in the root document.
- Params:
none - Returns:
void
- React / Next.js
- Other Frameworks
setSettings
- Update notification settings configuration for the current user.
- Here you need to provide the id of the channel config and its value id.
- Params:
NotificationSettingsConfig - Here is what the value types mean:
ALL: Subscribes the user to all notifications whether or not the user is involved in the notification on the current document.MINE: Subscribes the user to notifications that are related to the current user on the current document.NONE: Subscribes the user to no notifications on this channel on the current document.
- Returns:
void
- React / Next.js
- Other Frameworks
Using Hook:Using API:
getSettings
- Get the current notification settings configuration for the user on the current document.
- Params:
none - Returns:
Observable<NotificationSettingsConfig>
- React / Next.js
- Other Frameworks
Using Hook:Using API:
Notification Delivery
Batching and Delay Configuration
Configure a delay-and-batch pipeline for notification delivery. When enabled, notifications pass through a delay hold, a seen check, and optional batching before being delivered.This configuration is set at the API Key level in the Velt Console. It applies to all documents in the organization.
- Delay: Holds the notification for
delaySecondsbefore proceeding. - Seen check: If the recipient has already seen the triggering activity during the delay window, the notification is suppressed.
- Batch: Collects additional activities within the batch window before flushing as a single digest.
- Deliver: Sends the notification (or batched digest) to the recipient.
maxActivities) triggers a flush for that scope.
