Architecture
Activity Logs use a 2-layer trigger-listener architecture:- Feature layer (record creation): A record is generated whenever a user interacts with a Velt feature, such as adding a comment, changing a comment status, reacting, or editing a CRDT document. Each record includes the user, action type, target object, timestamp, and document context.
-
Subscription layer (record delivery):
getAllActivities()opens a real-time subscription that pushes records to your UI as they’re created. You can scope the subscription org-wide or filter bydocumentId,userId, or feature type.
Automatic Activity Logging
Velt generates records for the following features out of the box:- Comments: Record created on add, edit, delete, status change, and @mention.
- Reactions: Record created when a reaction is added or removed.
- Recorder: Record created on recording start, stop, and playback events.
- CRDT edits: Record created per edit batch. Use
setActivityDebounceTime(ms)to control how keystrokes are grouped into a single record. For example,setActivityDebounceTime(5000)batches all edits within a 5-second window into one activity log entry, keeping the feed meaningful rather than noisy.
Custom Activity Logs
UsecreateActivity() to push your own events into the same feed:
Querying and Filtering
getAllActivities() returns a real-time subscription. You can scope it to fit different UI patterns:
- Org-wide feed: No filters. Returns all activity across every document in the organization. Useful for admin dashboards and team lead overviews.
- Per-document timeline: Filter by
documentIdto show the full history of a single document, from first draft to final approval. Useful for inline review panels and document sidebars. - Feature-scoped feed: Filter by feature type (e.g., only Comments or only CRDT edits) to reduce noise for specific views.
Immutability
Activity log records can be made immutable by turning on the config in Velt Console. When immutability is enabled, records cannot be edited or deleted after creation, giving you a tamper-evident audit trail that holds up under compliance scrutiny. This is critical for regulated workflows (SOX, SOC 2, HIPAA) where auditors need to verify that the record of who approved what, and when, has not been altered after the fact. When immutability is off (the default), records can be updated or removed through the SDK and REST API as needed.Common Patterns
- Audit trail for regulated workflows: Surface a “who approved what, when” log for processes like invoice sign-offs, legal reviews, or budget approvals. Enable the Immutability config in Velt Console to ensure records cannot be altered after creation, with full user attribution and timestamps suitable for SOX, SOC 2, or any compliance context requiring a tamper-evident record.
- Unified event stream: Combine Velt activity with your app’s own events using
createActivity()so reviewers see one timeline instead of checking multiple systems. - AI agent traceability: When AI agents post comments or trigger approvals via the API, each action generates an activity log record, giving human reviewers a clear trail of what the agent did and when.
Activity Log Action Types
Use the exported constant objects for type-safeactionTypes filtering. Each constant’s values are string literals that correspond to the actions generated by that feature. See the Activity Log Action Type Constants reference for the full list of values.
CommentActivityActionTypes/CommentActivityActionType— Comment annotationsRecorderActivityActionTypes/RecorderActivityActionType— Recorder clipsReactionActivityActionTypes/ReactionActivityActionType— Inline reactionsCrdtActivityActionTypes/CrdtActivityActionType— CRDT edits

