Comments

useCommentUtils()

Hook to access comment utilities

Threads

useAddCommentAnnotation()

Hook to add a comment annotation

useDeleteCommentAnnotation()

Hook to delete a comment annotation

useCommentAnnotations()

Hook to get all comment annotations

useUnreadCommentAnnotationCountOnCurrentDocument()

Hook to get unread comment annotation count for current document

useUnreadCommentAnnotationCountByLocationId()

Hook to get unread comment annotation count by location

useCommentAnnotationById()

Hook to get a specific comment annotation

Messages

useAddComment()

Hook to add a comment to a specific annotation

useUpdateComment()

Hook to update a comment in a specific annotation

useDeleteComment()

Hook to delete a comment from a specific annotation

useGetComment()

Hook to get comments from a specific annotation

useUnreadCommentCountOnCurrentDocument()

Hook to get number of unread comments on current document

useUnreadCommentCountByLocationId()

Hook to get number of unread comments by location

useUnreadCommentCountByAnnotationId()

Hook to get number of unread comments by annotation

@Mentions

useContactUtils()

Hook to access contact utility methods

useAssignUser()

Hook to assign a user to a comment annotation

useContactSelected()

Hook to handle contact selection events

useSubscribeCommentAnnotation()

Hook to subscribe to a comment annotation

useUnsubscribeCommentAnnotation()

Hook to unsubscribe from a comment annotation

Custom Lists

useAutocompleteUtils()

Hook to access autocomplete utilities for custom lists in comments

useAutocompleteChipClick()

Hook to handle clicks on autocomplete chips in comments

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

useDeleteAttachment()

Hook to delete an attachment from a comment annotation

useGetAttachment()

Hook to get attachments from a comment annotation

Reactions

useAddReaction()

Hook to add a reaction to a comment

useDeleteReaction()

Hook to delete a reaction from a comment

useToggleReaction()

Hook to toggle a reaction on a comment

Status & Priority

useUpdateStatus()

Hook to update the status of a comment annotation

useResolveCommentAnnotation()

Hook to resolve a comment annotation

useUpdatePriority()

Hook to update the priority of a comment annotation

Recording

useDeleteRecording()

Hook to delete a recording from a comment annotation

useGetRecording()

Hook to get recordings from a comment annotation

Hook to get a link to a specific comment annotation

Hook to copy a comment annotation link to clipboard

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

Moderation

useApproveCommentAnnotation()

Hook to approve comment annotations in moderator mode

useAcceptCommentAnnotation()

Hook to accept comment annotations in suggestion mode

useRejectCommentAnnotation()

Hook to reject comment annotations in suggestion mode

useUpdateAccess()

Hook to update access permissions for comment annotations

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

useNotificationsData()

Hook to access notifications data for the current user

useUnreadNotificationsCount()

Hook to get count of unread notifications

  • Returns: Object with counts by tab
    {
      forYou: number,  // Unread in "For You" tab
      all: number      // Unread in "All" tab
    }
    
  • Automatically updates when unread status changes
  • Full Documentation →

Inline Reactions

useReactionElement()

Hook to access reaction element for utility methods

Recorder

useRecorderUtils()

Hook to access recorder element for utility methods

useRecordingDataByRecorderId()

Hook to fetch data for a specific recording

useRecorderAddHandler()

Hook to handle new recording events

  • Returns: Object containing:
    • id: string - Unique identifier for the recording
    • tag: 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

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 screens
    • initialValue: any - Initial value of the state
    • options?: object
      • syncDuration: 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 value
    • setValue: Function to update state
    • serverConnectionState: 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 editor
    • isEditorOnCurrentTab: boolean indicating if user is editor on current tab
  • Full Documentation →

useEditor()

Hook to get the current editor

useEditorAccessRequestHandler()

Hook to handle editor access requests

  • Returns: Object with:
    • requestStatus: ‘requested’ when access is requested
    • requestedBy: 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

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 locations
  • maxUsers: Limit number of displayed avatars
  • self: 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

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

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

Authentication

useIdentify()

Hook to authenticate a user with Velt

  • Parameters:
    • user: User
    • options?: Object:
      • authToken?: JWT token for additional security
      • forceReset?: 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 document
    • metadata?: Optional object containing:
      • documentName?: Name to display in Velt components
      • organizationId?: 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

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 identifier
      • locationName?: Optional display name for UI components
      • version?: Optional version object with:
        • id: Version identifier
        • name: Version display name
      • Additional custom key/value pairs
    • isAdditional?: Boolean to add additional locations
      • false (default): Set this as the root location
      • true: Add as additional location
  • Full Documentation →

Event Subscription

useVeltEventCallback()

Hook to subscribe to Velt core events

  • Params: eventType: string. Here is the list of events you can subscribe to.
  • Returns: VeltEventTypesMap[T]. It will return one of the objects from here