Overview
Velt supports self-hosting your reactions and related data:- Reactions can be stored on your own infrastructure, with only necessary identifiers on Velt servers.
- Velt Components automatically hydrate reaction data in the frontend by fetching from your configured data provider.
- This gives you full control over reaction data while maintaining all Velt collaboration features.
- This automatically also ensures that the in-app notifications content related to reactions is not stored on Velt servers. The content is generated using the reactions data in the frontend.
How does it work?
When users add or remove reactions:- The SDK uses your configured
ReactionAnnotationDataProviderto handle storage - Your data provider implements three key methods:
get: Fetches reactions from your databasesave: Stores reactions and returns success/errordelete: Removes reactions from your database
- The SDK first attempts to save/delete the reaction on your database
- If successful:
- The SDK updates Velt’s servers with minimal metadata
- The
PartialReactionAnnotationobject is updated with the reaction details including emoji, user, and metadata - When the reaction is saved, this information is stored on your end
- Velt servers only store necessary identifiers, not the actual reaction content
- If the operation fails, no changes are made to Velt’s servers and the operation is retried if you have configured retries.
get
Method to fetch reactions from your database. On error we will retry.- Param:
GetReactionResolverRequest - Return:
Promise<ResolverResponse<Record<string, PartialReactionAnnotation>>>
- Frontend Example
- Backend Endpoint Example (MongoDB)
- Backend Endpoint Example (PostgreSQL)
save
Save reactions to your database. Return a success or error response. On error we will retry.- Param:
SaveReactionResolverRequest - Return:
Promise<ResolverResponse<T>>
- Frontend Example
- Backend Endpoint Example (MongoDB)
- Backend Endpoint Example (PostgreSQL)
delete
Delete reactions from your database. Return a success or error response. On error we will retry.- Param:
DeleteReactionResolverRequest - Return:
Promise<ResolverResponse<T>>
- Frontend Example
- Backend Endpoint Example (MongoDB)
- Backend Endpoint Example (PostgreSQL)
config
Configuration for the reaction data provider.- Type:
ResolverConfig
Example Implementation
- React / Next.js
- Other Frameworks
Sample Data
- Reaction annotation stored on your database
- Comment object stored on your database
- Stored on Velt servers

