Hooks are React-only. In other frameworks the same data and actions live on the
Velt client’s elements (Velt.getCommentElement()), shown in the Other Frameworks tabs below. Full mapping: API methods.The model
Three kinds of hooks (full list inHooks; each maps to a client API method for other frameworks, e.g. useAddComment → commentElement.addComment()):
- Read:
useCommentAnnotations,useCommentAnnotationById,useUnreadCommentCountOnCurrentDocument,useCommentModeState, … → reactive data you render. - Mutate:
useAddCommentAnnotation,useAddComment,useUpdateComment,useDeleteComment,useResolveCommentAnnotation,useUpdateStatus,useToggleReaction, … → call these from your own buttons. - Control:
useVeltClient,useSetDocuments,useIdentify,useVeltInitState, … → init, scope, imperative control.
Steps
Render data from a read source
- React / Next.js
- Other Frameworks
Build objects to the SDK data model
Mutations expect objects shaped like Velt’s types (from For
@veltdev/types), and you construct them yourself:- React / Next.js
- Other Frameworks
addComment and updateComment, the Comment needs: commentId (auto if omitted), type ('text' | 'voice', default 'text'), from (a full User), commentText, commentHtml, status ('added' | 'updated'), and any array fields you touch. from is the field most often missed, and missing fields are the most common headless bug.Request objects
Actions take a single request object, not loose arguments. The same methods exist onVelt.getCommentElement() with identical names and shapes. Required fields only; all also accept options?:
The current shapes are the
*Request interfaces in @veltdev/types (AddCommentRequest, UpdateStatusRequest, …). Read the type if a call errors.
What it can and can’t do
If a wireframe can express the layout, prefer it: you keep Velt’s behavior for free and only restyle. Not sure? Point the UI Customization Plugin at your design and it will tell you whether a cheaper layer covers it.
Troubleshooting
Common headless symptoms, inDebugging:
- “Headless mutation does nothing, or errors”
- “My UI shows stale data after someone else changes a comment”
- “SSR or hydration error (Next.js)“
Checklist
- Using real hook names from
Hooks. - Objects passed to mutations match
@veltdev/types, with every required field. - Reactive data comes from read hooks; no manual polling.
- You’ve confirmed a wireframe genuinely can’t do it.

