Skip to main content
Source of truth: exhaustive for what it covers. Generated from Velt hook metadata.
  • If a name isn’t on this page, it doesn’t exist: don’t use it (a missing identifier resolves to undefined / renders nothing).
  • Never invent or guess a name; use only identifiers that appear verbatim here or that you verified against ground truth and added here.
  • Scope: exhaustive over @veltdev/react’s hook exports. Comment + notification + core hooks are documented in full; the remaining other-feature hooks are listed by name + return type + one-line purpose in “Other features (brief)” below: enough to keep the “a hook not listed doesn’t exist” invariant true, without full per-hook depth.
The hooks you use to build custom UI (Headless) or to add data-driven extras alongside any approach. All from @veltdev/react. Types from @veltdev/types. Grouped by purpose: read (data/state you render), mutate (actions you call), events (callbacks), control (init/scope/imperative). This lists the commonly-used comment hooks plus a brief map of other features; the SDK exports many more hooks following the same naming, but everything you need for the patterns in this guide is here.
Exhaustive over @veltdev/react’s hook exports: a hook not listed here doesn’t exist (source-of-truth invariant).

Read: data & state

Return shapes matter. Several read hooks return wrapper objects, not bare values (…Count*{ count }; useGetCommentAnnotations → a response object). Read the field, don’t render the object. When unsure of a return shape, console.log the hook’s value in your component to see it before rendering.

Mutate: actions

Most return an object with a function, e.g. const { addComment } = useAddComment(); then await addComment({ annotationId, comment }).

Events: callbacks

Control: init, scope, imperative


Imperative API via the client

Some controls aren’t hooks: call them on the comment element:
(These element APIs come from the typed comment element returned by client.getCommentElement().)

Other features (brief)

See Other features for how customization applies to these.

Other-feature hook exports (verified return types)

These are exported from @veltdev/react but belong to out-of-scope features. They are listed here only to keep the “a hook not listed doesn’t exist” invariant true: name, category, return type, and one-line purpose. Return types verified against ground truth.