Overview
Velt supports self-hosting your custom notification PII data:- Custom notification content (headline, body, source data) can be stored on your own infrastructure, with only necessary identifiers on Velt servers.
- Velt components automatically hydrate notification data in the frontend by fetching from your configured data provider.
- This gives you full control over notification PII while maintaining all Velt notification features.
How does it work?
When custom notifications are fetched or deleted:- The SDK uses your configured
NotificationDataProviderto handle retrieval and deletion. - Your data provider implements two optional methods:
get: Fetches notification PII from your databasedelete: Removes notification PII from your database
- The SDK calls your
gethandler with the notification IDs and organization ID. - If successful:
- The notification objects are hydrated with your returned PII fields.
- The
Notificationobject is updated withisNotificationResolverUsed: trueonce enriched via the notification resolver.
- If the operation fails, the notification is rendered without enriched PII, and the operation is retried if you have configured retries.
Implementation Approaches
You can implement notification self-hosting using either of these approaches:- Endpoint based: Provide endpoint URLs and let the SDK handle HTTP requests
- Function based: Implement
getanddeletemethods yourself
Endpoint based DataProvider
Instead of implementing custom methods, you can configure endpoints directly and let the SDK handle HTTP requests.headers may also be an async function resolved per request, and credentials ('include' | 'same-origin' | 'omit') enables cookie/session auth — see Async headers and credentials for details.getConfig
Config-based endpoint for fetching notification PII. The SDK automatically makes HTTP POST requests with the request body.- Type:
ResolverEndpointConfig - Request body format:
GetNotificationResolverRequest - Response format:
ResolverResponse<Record<string, PartialNotification>>
- React / Next.js
- Other Frameworks
deleteConfig
Config-based endpoint for deleting notification PII. The SDK automatically makes HTTP POST requests with the request body.- Type:
ResolverEndpointConfig - Request body format:
DeleteNotificationResolverRequest - Response format:
ResolverResponse<undefined>
- React / Next.js
- Other Frameworks
Endpoint based Complete Example
- React / Next.js
- Other Frameworks
Function based DataProvider
Implement custom methods to handle data operations yourself.get
Fetch notification PII data from your database. Called when notifications need to be hydrated in the frontend.- Param:
GetNotificationResolverRequest - Return:
Promise<ResolverResponse<Record<string, PartialNotification>>>
- React / Next.js
- Other Frameworks
delete
Remove notification PII from your database. Called when a custom notification is deleted.- React / Next.js
- Other Frameworks
config
Configuration for the notification data provider.- Type:
NotificationResolverConfig. Relevant properties:resolveTimeout: Timeout duration (in milliseconds) for resolver operationsgetRetryConfig:RetryConfig. Configure retry behavior for get operations.deleteRetryConfig:RetryConfig. Configure retry behavior for delete operations.
Function based Complete Example
- React / Next.js
- Other Frameworks
Writing Resolver-Eligible Notifications
To create a notification whose content will be resolved from your own infrastructure at read time, setisNotificationResolverUsed: true and notificationSource: 'custom' in your REST write. Omit displayHeadlineMessageTemplate and displayBodyMessage — the resolver will supply that content when the notification is fetched by the client.
Only notifications where
notificationSource === 'custom' are routed through the notification resolver. Notifications without this field will not call your data provider.Resolver Status Field
TheNotification object includes a field to detect whether the notification resolver was used:
Sample Data
- Stored on your database
- Stored on Velt servers
Debugging
You can subscribe todataProvider events to monitor and debug notification resolver operations.
- React / Next.js
- Other Frameworks

