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 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
| Feature | Function based | Endpoint based |
|---|---|---|
| Best For | Complex setups requiring middleware logic, dynamic headers, or transformation before sending | Standard REST APIs where you just need to pass the request “as-is” to the backend |
| Implementation | You write the fetch() or axios code | You provide the url string and headers object |
| Flexibility | High | Medium |
| Speed | Medium | High |
Endpoint based DataProvider
Instead of implementing custom methods, you can configure endpoints directly and let the SDK handle HTTP requests.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
Resolver Status Field
TheNotification object includes a field to detect whether the notification resolver was used:
| Field | Type | Description |
|---|---|---|
isNotificationResolverUsed | boolean | true once the notification has been enriched via the notification resolver. Use this field to detect resolver usage downstream. |
Debugging
You can subscribe todataProvider events to monitor and debug notification resolver operations.
- React / Next.js
- Other Frameworks

