Overview
Velt supports self-hosting your comments file attachments data:- Attachments can be stored on your own infrastructure, with only necessary identifiers on Velt servers.
- Velt Components automatically hydrate attachment data in the frontend by fetching from your configured data provider.
- This gives you full control over attachment data while maintaining the file attachment features.
How does it work?
When users upload or delete attachments:- The SDK uses your configured
AttachmentDataProviderto handle storage - Your data provider implements two key methods:
save: Stores the file and returns its URLdelete: Removes the file from storage
- The SDK first attempts to save/delete the file on your storage infrastructure
- If successful:
- The SDK updates Velt’s servers with minimal metadata
- The
PartialCommentobject is updated to reference the attachment including the attachment url, name and metadata. - When the comment is saved, this information is stored on your end.
- Velt servers only store necessary identifiers, not the actual files or URLs
- If the operation fails, no changes are made to Velt’s servers and the operation is retried if you have configured retries.
save
Save attachments to your storage backend. Return the url with a success or error response. On error we will retry.delete
Delete attachments from your storage backend. Return a success or error response. On error we will retry.config
Configuration for the attachment data provider.- Type:
ResolverConfig
Example Implementation
- React / Next.js
- Other Frameworks

