- This feature is currently in beta and is subject to change.
- This is currently only compatible with
setDocumentsmethod. - Ensure that the data providers are set prior to calling
identifymethod. - The data provider methods must return the correct status code (e.g. 200 for success, 500 for errors) and success boolean in the response object. This ensures proper error handling and retries.
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 attachments are uploaded or deleted, the SDK uses your configured
AttachmentDataProviderto handle storage - The data provider implements
saveanddeletemethods to interact with your storage backend - Velt handles the data mapping and realtime synchronization while delegating persistence of actual files to your infrastructure
- For write requests (save, delete), the operation is first performed on your storage backend and only if we get a success response, the SDK will perform the operation on the Velt server. If the operation fails on your storage backend, the SDK will not perform the operation on the Velt server.
- You can configure retries, timeouts, etc. for the data provider.
save
Save attachments to your storage backend. Return the url with a success or error response. On error we will retry.- Sample Request
- Sample Response
- Error Response
delete
Delete attachments from your storage backend. Return a success or error response. On error we will retry.- Sample Request
- Sample Response
- Error Response
config
Configuration for the attachment data provider.- Type:
ResolverConfig
AWS S3 Storage Implementation Example
Here’s how to implement the data provider methods with AWS S3:- Save Method
- Delete Method
- Complete Setup
Example Implementation
- React / Next.js
- Other Frameworks
Sample Data
- Stored on your storage
- Stored on Velt servers

