React Hooks Index
Comments
useCommentUtils()
Hook to access comment utilities
- Params:
void
- Returns:
CommentElement
- Related API Method:
client.getCommentElement()
- Full Documentation →
Threads
useAddCommentAnnotation()
Hook to add a comment annotation
- Returns:
addCommentAnnotation()
- Params: AddCommentAnnotationRequest
- Full Documentation →
useDeleteCommentAnnotation()
Hook to delete a comment annotation
- Returns:
deleteCommentAnnotation()
- Params: DeleteCommentAnnotationRequest
- Full Documentation →
useCommentAnnotations()
Hook to get all comment annotations
- Params:
documentId?: string, location?: Location
- Returns:
CommentAnnotation[]
- Full Documentation →
useUnreadCommentAnnotationCountOnCurrentDocument()
Hook to get unread comment annotation count for current document
- Params:
void
- Returns:
UnreadCommentsCount | null
- Full Documentation →
useUnreadCommentAnnotationCountByLocationId()
Hook to get unread comment annotation count by location
- Params:
locationId: string
- Returns:
UnreadCommentsCount | null
- Full Documentation →
useCommentAnnotationById()
Hook to get a specific comment annotation
- Params:
{ annotationId: string, documentId?: string }
- Returns:
CommentAnnotation
- Full Documentation →
Messages
useAddComment()
Hook to add a comment to a specific annotation
- Returns:
addComment()
- Params: AddCommentRequest
- Full Documentation →
useUpdateComment()
Hook to update a comment in a specific annotation
- Returns:
updateComment()
- Params: UpdateCommentRequest
- Full Documentation →
useDeleteComment()
Hook to delete a comment from a specific annotation
- Returns:
deleteComment()
- Params: DeleteCommentRequest
- Full Documentation →
useGetComment()
Hook to get comments from a specific annotation
- Returns:
getComment()
- Params: GetCommentRequest
- Full Documentation →
useUnreadCommentCountOnCurrentDocument()
Hook to get number of unread comments on current document
- Params:
void
- Returns:
UnreadCommentsCount | null
- Full Documentation →
useUnreadCommentCountByLocationId()
Hook to get number of unread comments by location
- Params:
locationId: string
- Returns:
UnreadCommentsCount | null
- Full Documentation →
useUnreadCommentCountByAnnotationId()
Hook to get number of unread comments by annotation
- Params:
annotationId: string
- Returns:
number
- Full Documentation →
@Mentions
useContactUtils()
Hook to access contact utility methods
- Returns:
ContactElement
with methods for managing contacts - Full Documentation →
useAssignUser()
Hook to assign a user to a comment annotation
- Returns:
assignUser()
- Params: AssignUserRequest
- Full Documentation →
useContactSelected()
Hook to handle contact selection events
- Returns:
User
- Full Documentation →
useSubscribeCommentAnnotation()
Hook to subscribe to a comment annotation
- Returns:
subscribeCommentAnnotation()
- Full Documentation →
useUnsubscribeCommentAnnotation()
Hook to unsubscribe from a comment annotation
- Returns:
unsubscribeCommentAnnotation()
- Full Documentation →
Custom Lists
useAutocompleteUtils()
Hook to access autocomplete utilities for custom lists in comments
- Returns:
AutocompleteElement
- Full Documentation →
useAutocompleteChipClick()
Hook to handle clicks on autocomplete chips in comments
- Returns:
AutocompleteItem
data when a chip is clicked - Full Documentation →
Event Subscription
useCommentEventCallback()
Hook to subscribe to comment events
- Params:
eventType: string
. Here is the list of events you can subscribe to. - Returns: Comment Event Object. It will return one of the objects from here
- Full Documentation →
Attachments
useAddAttachment()
Hook to add an attachment to a comment annotation
- Returns:
addAttachment()
- Params: AddAttachmentRequest
- Full Documentation →
useDeleteAttachment()
Hook to delete an attachment from a comment annotation
- Returns:
deleteAttachment()
- Params: DeleteAttachmentConfig
- Full Documentation →
useGetAttachment()
Hook to get attachments from a comment annotation
- Returns:
getAttachment()
- Params: GetAttachmentRequest
- Full Documentation →
Reactions
useAddReaction()
Hook to add a reaction to a comment
- Returns:
addReaction()
- Params: AddReactionRequest
- Full Documentation →
useDeleteReaction()
Hook to delete a reaction from a comment
- Returns:
deleteReaction()
- Params: DeleteReactionRequest
- Full Documentation →
useToggleReaction()
Hook to toggle a reaction on a comment
- Returns:
toggleReaction()
- Params: ToggleReactionRequest
- Full Documentation →
Status & Priority
useUpdateStatus()
Hook to update the status of a comment annotation
- Returns:
updateStatus()
- Params: UpdateStatusRequest
- Full Documentation →
useResolveCommentAnnotation()
Hook to resolve a comment annotation
- Returns:
resolveCommentAnnotation()
- Params: ResolveCommentAnnotationRequest
- Full Documentation →
useUpdatePriority()
Hook to update the priority of a comment annotation
- Returns:
updatePriority()
- Params: UpdatePriorityRequest
- Full Documentation →
Recording
useDeleteRecording()
Hook to delete a recording from a comment annotation
- Returns:
deleteRecording()
- Params: DeleteRecordingRequest
- Full Documentation →
useGetRecording()
Hook to get recordings from a comment annotation
- Returns:
getRecording()
- Params: GetRecordingRequest
- Full Documentation →
Deep Link
useGetLink()
Hook to get a link to a specific comment annotation
- Returns:
getLink()
- Params: GetLinkRequest
- Full Documentation →
useCopyLink()
Hook to copy a comment annotation link to clipboard
- Returns:
copyLink()
- Params: CopyLinkRequest
- Full Documentation →
Navigation
useCommentSelectionChangeHandler()
Hook to subscribe to comment selection changes
- Returns:
CommentSelectionChangeData
with:selected: boolean
annotation: CommentAnnotation
- Full Documentation →
UI
useCommentDialogSidebarClickHandler()
Hook to handle clicks on the sidebar button in the comment dialog
- Returns: Event data
- Full Documentation →
Moderation
useApproveCommentAnnotation()
Hook to approve comment annotations in moderator mode
- Returns:
approveCommentAnnotation()
- Params: ApproveCommentAnnotationRequest
- Full Documentation →
useAcceptCommentAnnotation()
Hook to accept comment annotations in suggestion mode
- Returns:
acceptCommentAnnotation()
- Params: AcceptCommentAnnotationRequest
- Full Documentation →
useRejectCommentAnnotation()
Hook to reject comment annotations in suggestion mode
- Returns:
rejectCommentAnnotation()
- Params: RejectCommentAnnotationRequest
- Full Documentation →
useUpdateAccess()
Hook to update access permissions for comment annotations
- Returns:
updateAccess()
- Params: UpdateAccessRequest
- Full Documentation →
Comment Tool
useCommentModeState()
Hook to track the current state of comment mode
- Returns:
boolean
indicating if comment mode is active - Automatically updates when comment mode changes
- Full Documentation →
Notifications
useNotificationUtils()
Hook to access notification element for utility methods
- Returns:
NotificationElement
- Full Documentation →
useNotificationsData()
Hook to access notifications data for the current user
- Returns: Array of
Notification
objects - Automatically updates when notifications change
- Full Documentation →
useUnreadNotificationsCount()
Hook to get count of unread notifications
- Returns: Object with counts by tab
- Automatically updates when unread status changes
- Full Documentation →
Inline Reactions
useReactionElement()
Hook to access reaction element for utility methods
- Returns:
ReactionElement
- Full Documentation →
Recorder
useRecorderUtils()
Hook to access recorder element for utility methods
- Returns:
RecorderElement
- Full Documentation →
useRecordingDataByRecorderId()
Hook to fetch data for a specific recording
- Parameters:
recorderId
: string - ID of the recording to fetch
- Returns:
RecorderData
- Full Documentation →
useRecorderAddHandler()
Hook to handle new recording events
- Returns: Object containing:
id
: string - Unique identifier for the recordingtag
: string - HTML tag to embed the recording player
- Automatically updates when new recordings are added
- Full Documentation →
View Analytics
useViewsElement()
Hook to access views element for utility methods
- Returns:
ViewsElement
- Full Documentation →
useUniqueViewsByUser()
Hook to get unique views grouped by user
- Parameters:
locationId
: Optional string to filter by location
- Returns: Array of view analytics data by user
- Full Documentation →
useUniqueViewsByDate()
Hook to get unique views grouped by date
- Parameters:
locationId
: Optional string to filter by location
- Returns: Array of view analytics data by date
- Full Documentation →
Live State Sync
useLiveStateSyncUtils()
Hook to access live state sync utilities
- Params:
void
- Returns:
LiveStateSyncElement
- Related API Method:
client.getLiveStateSyncElement()
- Full Documentation →
useLiveStateData()
Hook to get live state data
- Params:
string
- Returns:
any
- Related API Method:
liveStateSyncElement.getLiveStateData()
- Full Documentation →
useSetLiveStateData()
Hook to set live state data
- Params:
string, any
- Returns:
void
- Related API Method:
liveStateSyncElement.setLiveStateData()
- Full Documentation →
useLiveState()
Hook to sync state variables across clients in real-time (similar to React’s useState)
- Params:
uniqueId
: string - Unique identifier to sync across screensinitialValue
: any - Initial value of the stateoptions?
: objectsyncDuration
: number - Debounce duration in ms (default: 50)resetLiveState
: boolean - Reset state on init (default: false)listenToNewChangesOnly
: boolean - Only listen to new changes (default: false)
- Returns:
[value, setValue, serverConnectionState]
value
: Current state valuesetValue
: Function to update stateserverConnectionState
: Current server connection state
- Full Documentation →
useServerConnectionStateChangeHandler()
Hook to listen to server connection state changes
- Params: none
- Returns:
ServerConnectionState
- One of:'online'
- Server connection is active'offline'
- Server connection is lost'pendingInit'
- Connection initialization pending'pendingData'
- Waiting for data from server
- Related API Method:
liveStateSyncElement.onServerConnectionStateChange()
- Full Documentation →
Single Editor Mode
useUserEditorState()
Hook to check if current user is the editor
- Returns:
UserEditorAccess
object with:isEditor
: boolean indicating if user is editorisEditorOnCurrentTab
: boolean indicating if user is editor on current tab
- Full Documentation →
useEditor()
Hook to get the current editor
- Returns:
User
object with editor details (email, name, photoUrl, userId) - Full Documentation →
useEditorAccessRequestHandler()
Hook to handle editor access requests
- Returns: Object with:
requestStatus
: ‘requested’ when access is requestedrequestedBy
: User object of requester
- Returns
null
if user is not editor or request is canceled - Full Documentation →
useEditorAccessTimer()
Hook to track editor access request timer state
- Returns: Object with:
state
: ‘idle’ | ‘inProgress’ | ‘completed’durationLeft
: number of seconds remaining
- Useful for building custom UI for access requests
- Full Documentation →
Presence
usePresenceUtils()
Hook to access presence element for presence control methods
- Returns:
PresenceElement
- Full Documentation →
usePresenceUsers()
Hook to get online users on the current document
- Returns:
User[]
- Related API Method:
presenceElement.getOnlineUsersOnCurrentDocument()
- Full Documentation →
Note: Most presence functionality can also be controlled through <VeltPresence>
props:
inactivityTime
: Set user inactivity timeout (default: 300000ms)location
: Show presence for specific locationsmaxUsers
: Limit number of displayed avatarsself
: Control visibility of current user (default: true)
Cursor
useCursorUtils()
Hook to access cursor element for cursor utility methods
- Returns:
CursorElement
useCursorUsers()
Hook to get online users with cursors activated
- Params:
void
- Returns:
User[]
- Related API Method:
cursorElement.getOnlineUsersOnCurrentDocument()
- Full Documentation →
Live Selection
useLiveSelectionUtils()
Hook to access live selection element for control methods
- Returns:
LiveSelectionElement
- Full Documentation →
useLiveSelectionDataHandler()
Hook to get live selection data for the current document
- Returns:
LiveSelectionData
- Related API Method:
liveSelectionElement.getLiveSelectionData()
- Full Documentation →
Huddle
useHuddleUtils()
Hook to access huddle utilities
- Params:
void
- Returns:
HuddleElement
- Related API Method:
client.getHuddleElement()
- Full Documentation →
AI
useAIRewriterUtils()
Hook to access AI rewriter utilities
- Params:
void
- Returns:
RewriterElement
- Related API Method:
client.getRewriterElement()
Core
Client
useVeltClient()
Hook to access the Velt client instance
- Returns: Object with:
client
: Velt
useVeltInitState()
Hook to get Velt initialization state
- Params:
void
- Returns:
boolean
- Related API Method:
client.getVeltInitState()
- Full Documentation →
Authentication
useIdentify()
Hook to authenticate a user with Velt
- Parameters:
user
:User
options?
: Object:authToken?
: JWT token for additional securityforceReset?
: Force re-login (default: false)
- Must be called within a child component of VeltProvider
- Asynchronous operation
- Full Documentation →
Document
useSetDocument()
Hook to initialize a document for collaboration
- Parameters:
documentId
: Unique identifier for the documentmetadata?
: Optional object containing:documentName?
: Name to display in Velt componentsorganizationId?
: Organization ID. Use when you want to access the document from another organization.- Additional custom key/value pairs
- Full Documentation →
useUnsetDocumentId()
Hook to remove the current document context
- Use when Velt features are not needed
- Cleans up document-specific resources
- Full Documentation →
Location
useSetLocation()
Hook to set the current location context. Used to define specific areas within a document.
- Parameters:
location
: Location object with:id
: Required unique identifierlocationName?
: Optional display name for UI componentsversion?
: Optional version object with:id
: Version identifiername
: Version display name
- Additional custom key/value pairs
isAdditional?
: Boolean to add additional locationsfalse
(default): Set this as the root locationtrue
: Add as additional location
- Full Documentation →
Event Subscription
useVeltEventCallback()
Hook to subscribe to Velt core events
Was this page helpful?