Customize Behavior
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.
You can set it on Notifications Tool:
You can alternatively set it on Notifications Panel if you have directly embedded it:
Using APIs:
You can set it on Notifications Tool:
You can alternatively set it on Notifications Panel if you have directly embedded it:
Using APIs:
You can set it on Notifications Tool:
You can alternatively set it on Notifications Panel if you have directly embedded it:
Using APIs:
Using APIs:
setMaxDays
Notifications older than the specified number of days will not be displayed.
Default: 15 days.
Using API:
Using API:
Using API:
Using APIs:
panelOpenMode
Notificaitons 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.
Default: popover
.
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.
Default: false
.
Using Props:
Using APIs:
Using Props:
Using APIs:
Using Props:
Using APIs:
Using Props:
Using API:
Data
getNotificationsData
- Get the notifications data for the current user.
- Returns
Notification[]
To unsubscribe from the subscription:
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.
Sample response:
Using Hooks:
Using API:
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.
Event Type | Description | Event Object |
---|---|---|
settingsUpdated | Triggered when the settings are updated by the user using UI or the API | SettingsUpdatedEvent |
onNotificationClick
- The
onNotificationClick
event fires when a notification is clicked in the Notifications Panel. - It returns a
Notification
object 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.
Actions
setAllNotificationsAsRead
- Mark all notifications as read, either globally or for a specific tab.
- Using ‘all’ or ‘document’ as the
tabId
marks all notifications as read across all tabs (equivalent to callingsetAllNotificationsAsRead()
without arguments). - Using ‘for-you’ as the
tabId
only marks notifications in the ‘for-you’ tab as read.
markNotificationAsReadById
- Mark a single notification as read using its notificationId.
- The notification will be marked as read in all tabs.
Notification Settings
This feature currently only updates the settings for the current user in the current Velt document. If you are using multiple documents or folders, the settings will apply to the root document.
enableSettings
- Enable or disable the settings feature for notifications. This allows users to configure their notification preferences.
- Params:
none
- Returns:
void
Make sure to first enable the settings feature in Velt Console.
Using Props:
Using APIs:
Using Props:
Using APIs:
Using Props:
Using APIs:
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
Default:
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
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
getSettings
- Get the current notification settings configuration for the user on the current document.
- Params:
none
- Returns:
NotificationSettingsConfig