# Conditional Templates * Conditional Templates let you conditionally show or hide parts of the Velt Component Wireframes. * You can add conditions based on the same data models available in [Template Variables](/advanced-customization/template-variables). ## Usage ```jsx {/* Content to render if condition is true */} ``` ```html ``` ## Syntax The condition is specified as a string that will be evaluated as a JavaScript expression. You can use: * Comparison operators: `===`, `==`, `!==`, `>`, `<`, `>=`, `<=` * Logical operators: `&&`, `||`, `!` * Template variables enclosed in curly braces: `{variable.property}` ## Example Usage ```jsx {/* 1. Show content only for open annotations: */}

This annotation is currently open.

{/* 2. Display a message for annotations with more than 5 comments: */}

This is a popular annotation!

{/* 3. Combine multiple conditions: */}

This is a new open annotation without any comments yet.

```
```html

This annotation is currently open.

This is a popular annotation!

This is a new open annotation without any comments yet.

```
# Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/dark-light-mode.png) You can customize components by enabling Dark Mode. By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. To enable Dark Mode for all components: ```jsx let client = useVeltClient(); client.setDarkMode(true); ``` To enable Dark Mode for individual components: ```jsx ``` API Method: ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/dark-light-mode.png) You can customize components by enabling Dark Mode. By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. To enable Dark Mode for all components: ```jsx let client = useVeltClient(); client.setDarkMode(true); ``` To enable Dark Mode for individual components: ```html ``` API Method: ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ```jsx React / Next.js import { VeltComments, useVeltClient } from '@veltdev/react'; import { useEffect } from 'react' export default function YourDocument() { const { client } = useVeltClient(); useEffect(()=>{ if(client){ const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); } }) return (
) } ``` ```html HTML ```
# Remove Shadow DOM ## Disable ShadowDOM If you want to customize components using global CSS, you can do so by disabling the ShadowDOM. By default, a ShadowDOM is used with certain components to ensure that your application's CSS does not interfere with the styling of the SDK components. If you want your application's CSS to affect the styling of certain SDK components, you can disable the ShadowDOM. There are different properties and methods that can be used to disable the ShadowDOM of individual components. Examples: ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePinShadowDOM(); commentElement.disablePinShadowDOM(); commentElement.enableDialogShadowDOM(); commentElement.disableDialogShadowDOM(); commentElement.enableSidebarShadowDOM(); commentElement.disableSidebarShadowDOM(); ``` ## Disable ShadowDOM If you want to customize components using global CSS, you can do so by disabling the ShadowDOM. By default, a ShadowDOM is used with certain components to ensure that your application's CSS does not interfere with the styling of the SDK components. If you want your application's CSS to affect the styling of certain SDK components, you can disable the ShadowDOM. There are different properties and methods that can be used to disable the ShadowDOM of individual components. ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePinShadowDOM(); commentElement.disablePinShadowDOM(); commentElement.enableDialogShadowDOM(); commentElement.disableDialogShadowDOM(); commentElement.enableSidebarShadowDOM(); commentElement.disableSidebarShadowDOM(); ``` ```jsx React / Next.js import { VeltCommentBubble } from '@veltdev/react'; import { useEffect } from 'react' export default function YourDocument() { return (
) } ``` ```html HTML ```
# Use CSS Library You can use a CSS library such as Tailwind to style the SDK components. Simply add the library's classes to the SDK components just like you would to any other component. To add Custom CSS, ensure that the [Shadow DOM is turned off](./remove-shadow-dom) for the SDK component you are styling. Conceptual Example: ```jsx ... {/* Header */}
...
```
You can use a CSS library such as Tailwind to style the SDK components. Simply add the library's classes to the SDK components just like you would to any other component. To add Custom CSS, ensure that the [Shadow DOM is turned off](./remove-shadow-dom) for the SDK component you are styling. Conceptual Example: ```jsx ...
...
```
```jsx React / Next.js {/* Skeleton */} {/* Header */}
{/* Filter */} {/* List */} {/* Empty Placeholder */} {/* Page Mode Composer */}
``` ```HTML HTML
```
# Use Custom CSS ## Add Custom CSS To add custom CSS to the component, just add CSS into the wireframe template. To add Custom CSS, ensure that the [Shadow DOM is turned off](./remove-shadow-dom) for the SDK component you are styling. Conceptual Example: ```jsx ... {/* Header */}
...
```
## Add Custom CSS To add custom CSS to the component, just add CSS into the wireframe template. To add Custom CSS, ensure that the [Shadow DOM is turned off](./remove-shadow-dom) for the SDK component you are styling. Conceptual Example: ```jsx ...
...
```
```jsx React / Next.js {/* Skeleton */} {/* Header */}
{/* Filter */} {/* List */} {/* Empty Placeholder */} {/* Page Mode Composer */}
``` ```HTML HTML
```
# Replace component layout You can change the default HTML of Velt Components by providing your own HTML as a child of the component. ```jsx
Attachments
```
```html
Attachments
```
# Reorder Components To modify the order of subcomponents, simply rearrange them within the wireframe template. The rendered component will reflect this new order. For example, you can change the order of components in the header of a comment dialog. ```jsx ``` ```html ``` # Overview You can change the default HTML of Velt Components using two patterns: If you modify the component using both the `Standalone` and `Hierarchical` patterns, the `Hierarchical` pattern will override the `Standalone` pattern. ### Patterns #### a. Standalone Component Customization (recommended): * This pattern lets you modify any Velt Component without the need to include all of its siblings. e.g., Composer submit button, Comment Dialog Header. * By focusing on individual components, this approach simplifies the customization process and enhances maintainability. * It provides greater flexibility and granular control over specific parts of the UI without needing to write the entire component structure. ```jsx
Custom HTML
```
```html
Custom HTML
```
#### b. Hierarchical Component Customization * This pattern lets you modify any Velt Component by specifying its entire structure. * This approach facilitates easier modifications to multiple sibling components simultaneously, offering a larger control on the component's: * structure and hierarchy. * styling relationships between sibling components. * The trade-off is writing more code. ```jsx {/* Ghost Banner */} {/* Assignee Banner */}
{/* Increase gap between components */} {/* Header */} {/* Body */} {/* Composer */}
{/* All Comments */}
```
```html
```
# Remove Components To remove a subcomponent from appearing, simply delete it from the wireframe template. In this example priority and copy link buttons are removed from the header. ```jsx ``` ```html ``` # Overview You can fully customize any Velt Component. Here are some concepts that will help you get started. Once you know them, you can follow the [general setup guide](/advanced-customization/setup) to start customizing components. ## 1. Wireframes ### a. What is a Wireframe? * Wireframes are powerful templates that define the structure and appearance of Velt components, serving as a blueprint for customizing their default layout and styling. * When you want to modify a component's appearance, you do so by altering its corresponding wireframe, which acts as a global definition determining how components will be displayed. * Wireframes themselves don't render directly in your application. After customizing a wireframe, you still need to place the actual Velt components in your app as usual, which will then render according to your customized wireframe definitions. ### b. How to customize a Wireframe? * Add the root Wireframe component. * Find the Wireframe component of the target Velt Component. Add it inside the root Wireframe. * Modify the target component wireframe by either adding custom HTML as children inside it or by adding custom styling. ### c. What can go inside a Wireframe? You can add the following inside a Wireframe: * Custom HTML * Custom inline styling on non-Velt components * Velt's wireframe components You cannot add: * Regular Velt Components inside a Wireframe * Custom inline styling on Velt components. Instead, you can wrap Velt Wireframe components in regular HTML components and style them with inline css. ### d. How to use a customized Wireframe? After modifying a Wireframe template: * Place the regular Velt component in your app as usual * The component will render with the layout changes defined in your customized Wireframe * You'll see the updated appearance reflecting your template modifications ## 2. Make Layout Changes Adding children will remove the CSS for that component. If you add an empty wireframe with no children, it will keep its original style and children. ### a. Replace component layout To completely change the layout of Velt's components, provide your own custom HTML as children within the target component's wireframe. [Learn more](/advanced-customization/customize-layout/change-default-html). ### b. Remove components To remove a subcomponent, simply delete it from the wireframe template. This will prevent it from appearing in the rendered component. [Learn more](/advanced-customization/customize-layout/remove-existing). ### c. Reorder components To change the order of subcomponents, simply rearrange them within the wireframe template. The rendered component will reflect this new order. [Learn more](/advanced-customization/customize-layout/change-order). ## 3. Make CSS Changes ### a. Remove Shadow DOM * Shadow DOM is enabled by default for Velt Components. This prevents CSS from the host app affecting Velt Components. * Disable Shadow DOM for specific components to allow your app's CSS to style Velt Components. This affects the component and its children. [Learn more](/advanced-customization/customize-css/remove-shadow-dom). ### b. Add Dark Mode Velt components default to light mode. To enable dark mode for specific components, use the component's designated prop or API method. [Learn more](/advanced-customization/customize-css/dark-mode). ### c. Use CSS Library To style Velt components with a CSS library like Tailwind: 1. Disable Shadow DOM 2. Add the library's classes inside the wireframe or directly on the rendered Velt components. You can find the component CSS selectors by inspecting the component in the browser's developer tools. This works just like styling any other component in your application. [Learn more](/advanced-customization/customize-css/use-css-library). ### d. Use Custom CSS Same as above, you can add your classes to the wireframes or directly on the rendered Velt components. [Learn more](/advanced-customization/customize-css/use-custom-css). ## 5. Template Variables You can render dynamic data from these certain Data Classes inside your Velt Components Wireframe. [Learn more](/advanced-customization/template-variables). ## 6. Conditional Templates You can conditionally show or hide parts of the Velt Component Wireframes. [Learn more](/advanced-customization/conditional-templates). ## 6. Variants If you want to have multiple versions of customized components that you can swap between, you can use variants. [Learn more](/advanced-customization/variants) # General Setup ## 1. Add the Velt Wireframe component * Add the `Velt Wireframe` component to the root of your app. * Add the wireframes of any components you want to customize within the `Velt Wireframe` component. ```jsx import { VeltWireframe, VeltProvider } from '@veltdev/react' ``` ```jsx {/* Customized component wireframes go here */} ``` Add the inline `style="display:none;"` CSS attribute to the `` element to ensure it's never displayed on the DOM. While we automatically handle this, there might be instances where the wireframe becomes visible if the SDK hasn't initialized yet. ```html ``` ## 2. Add a component's wireframe * Copy the `wireframe` of the component you want to modify. You will find the wireframe for each component within it's feature documentation. * Place it inside the `Velt Wireframe` component. ```jsx ``` ```html ``` ## 3. Customize the wireframe template * Modify the layout of the `wireframe` by: * Adding custom HTML or CSS * Reorganizing subcomponents * Removing subcomponents within the template * To customize multiple components, simply add more Wireframes as children to the `Velt Wireframe` component. If you add any children to a Wireframe, the default styling of that particular component will be removed ```jsx
Custom HTML
```
```html
Custom HTML
```
## 4. Add the component Now that you've modified the wireframe, place the component (not the wireframe) in your app layout as you normally would The `wireframe` components are not meant to be rendered directly in your application. They serve as template definitions that specify how Velt components will render globally. After defining your wireframes, you should still place the actual Velt components in your app layout as you normally would. ```jsx
```
```html
```
# Template Variables You can render dynamic data from these Data Classes inside your Velt Components Wireframe. ## Types There are two types of template variables: **1. Global Template Variables:** These can be used across all components. example: the current logged in `User` is available across all components. **2. Local Template Variables:** These are only available within the component it's data class is used. Eg: `CommentAnnotation` is only avaialable within the comment dialog container and its child components. ## Syntax * Refer the supported Class' fields in the `field` field of the `Velt Data` component. * You can refer to nested fields using the dot notation. ```jsx ``` ```jsx ``` ## Global Template Variables ### **1. User** This represents the current logged-in user. It is available across all components. Learn more about the User data class [here](/api-reference/models/User). ### **2. Unread Comment Annotation Count** This represents the number of unread comment annotations on the current document. ### **3. Unread Comment Count** This represents the total number of unread comments on the current document. ## Local Template Variables ### **1. UserContact** This represents the user contact object (it has the same class as the User). It is available on the autocomplete component where the user contacts are rendered. Learn more about the UserContact data class [here](/api-reference/models/User). ### **2. CommentAnnotation** This represents the comment thread. This is available within the comment feature components. Learn more about the CommentAnnotation data class [here](/api-reference/models/CommentAnnotation). ### **3. Comment** This represents the message inside the thread. This is available within the comment feature components. Learn more about the Comment data class [here](/api-reference/models/Comment). ## Example Usage ```jsx ``` ```jsx ``` # Variants Variants allow you to create and use multiple customized versions of a single component in different parts of your app. Example: You can have a customized Comment Dialog for the sidebar and another for the pin. ## 1. Define a Variant To define a variant: * Add a template of the component wireframe to the `Velt Wireframe` component * Give it a `variant` name ```jsx #Your wireframe for the variant #Your wireframe for the variant ``` ```html #Your wireframe for the variant #Your wireframe for the variant ``` ## 2. Use a Variant To apply a specific variant, simply set the `variant` prop when using the Velt component in your app. ```jsx ``` ```html ``` ## 3. Pre-defined Variants * Some components have pre-defined variants with reserved names and specific functionality * To customize pre-defined variants: 1. Add the `variant` property with its reserved name to the specific Velt Wireframe component you want to customize 2. Provide the customized template for that variant within the wireframe component * Check each component's customization documentation for available pre-defined variants For example, the `Comment Dialog` has two pre-defined `variants`: ```jsx {/* This pre-defined variant will change the appearance of the Comment Dialog within Pin, Area, and Text comments only */} #Your wireframe for variant {/* This pre-defined variant will change the appearance of the Comment Dialog within the Sidebar only */} #Your wireframe for variant ``` ```html #Your wireframe for variant #Your wireframe for variant ``` ## 4. Unsupported Components Some components currently do not support `variants`. Please check the customization docs for each component to check if `variants` are supported. # null ## getAllCommentAnnotations() Subscribe to comments on the current document. * **Signature**: `getAllCommentAnnotations(documentId?: string, location?: object)` * **Params**: `documentId?: string, location?: object` * **Returns**: `Observable` ## deleteSelectedComment() To delete selected comments. * **Signature**: `deleteSelectedComment()` * **Params**: none * **Returns**: `Promise` ## selectCommentByAnnotationId() To select comment by annotation ID. * **Signature**: `selectCommentByAnnotationId(annotationId?: string)` * **Params**: `annotationId` * **Returns**: void ## enableAreaComment() To enable area comment. * **Signature**: `enableAreaComment()` * **Params**: none * **Returns**: void ## disableAreaComment() To disable area comment. * **Signature**: `disableAreaComment()` * **Params**: none * **Returns**: void ## enableTextComments() To enable text comment selection. * **Signature**: `enableTextComments()` * **Params**: none * **Returns**: `any` ## disableTextComments() To disable text comment selection. * **Signature**: `disableTextComments()` * **Params**: none * **Returns**: `any` ## allowedElementIds() To allow text selection in specific elements only. * **Signature**: `allowedElementIds(elementIds: string[])` * **Params**: `elementIds: string[]` * **Returns**: `any` ## allowedElementClassNames() To allow adding comments in specific elements only. * **Signature**: `allowedElementClassNames(classNames: string[])` * **Params**: `classNames: string[]` * **Returns**: `any` ## allowedElementQuerySelectors() To allow adding comments in specific elements only. * **Signature**: `allowedElementQuerySelectors(querySelectors: string[])` * **Params**: `querySelectors: string[]` * **Returns**: `any` ## updateCommentDialogPosition() To update comment dialog position. * **Signature**: `updateCommentDialogPosition()` * **Params**: none * **Returns**: void ## enableFloatingCommentDialog() To enable floating comment dialog. * **Signature**: `enableFloatingCommentDialog()` * **Params**: none * **Returns**: `any` ## disableFloatingCommentDialog() To disable floating comment dialog. * **Signature**: `disableFloatingCommentDialog()` * **Params**: none * **Returns**: `any` ## attachComment() To add comments on specific elements. * **Signature**: `attachComment(elementId: string)` * **Params**: `elementId: string` * **Returns**: `any` ## openCommentSidebar() To open comment sidebar. * **Signature**: `openCommentSidebar()` * **Params**: none * **Returns**: `any` ## closeCommentSidebar() To close comment sidebar. * **Signature**: `closeCommentSidebar()` * **Params**: none * **Returns**: `any` ## toggleCommentSidebar() To toggle comment sidebar. * **Signature**: `toggleCommentSidebar()` * **Params**: none * **Returns**: `any` ## enableModeratorMode() To enable moderator mode. * **Signature**: `enableModeratorMode()` * **Params**: none * **Returns**: `any` ## disableModeratorMode() To disable moderator mode. * **Signature**: `disableModeratorMode()` * **Params**: none * **Returns**: `any` ## enableStreamMode() To enable stream mode. * **Signature**: `enableStreamMode()` * **Params**: none * **Returns**: `any` ## disableStreamMode() To disable stream mode. * **Signature**: `disableStreamMode()` * **Params**: none * **Returns**: `any` ## enableSignInButton() To show sign in button in comments if user is signed out. * **Signature**: `enableSignInButton()` * **Params**: none * **Returns**: `any` ## disableSignInButton() To hide sign in button in comments if user is signed out. * **Signature**: `disableSignInButton()` * **Params**: none * **Returns**: `any` ## enableUpgradeButton() To enable upgrade button in comments when plan is expired. * **Signature**: `enableUpgradeButton()` * **Params**: none * **Returns**: `any` ## disableUpgradeButton() To disable upgrade button in comments when plan is expired. * **Signature**: `disableUpgradeButton()` * **Params**: none * **Returns**: `any` ## onCommentModeChange() Subscribe to comment mode change. * **Signature**: `onCommentModeChange()` * **Params**: none * **Returns**: `Observable` ## enableAttachments() Enable attachments feature in comments. * **Signature**: `enableAttachments()` * **Params**: none * **Returns**: `any` ## disableAttachments() Disable attachments feature in comments. * **Signature**: `disableAttachments()` * **Params**: none * **Returns**: `any` ## isUserGlobalContact() Get if user is part of global contact or not. * **Signature**: `isUserGlobalContact()` * **Params**: none * **Returns**: `Observable` ## enableDeviceInfo() Enable device info in comments. * **Signature**: `enableDeviceInfo()` * **Params**: none * **Returns**: `any` ## disableDeviceInfo() Disable device info in comments. * **Signature**: `disableDeviceInfo()` * **Params**: none * **Returns**: `any` ## enableCommentMode() Enable comment mode to add comments. * **Signature**: `enableCommentMode()` * **Params**: none * **Returns**: `any` ## disableCommentMode() Disable comment mode. * **Signature**: `disableCommentMode()` * **Params**: none * **Returns**: `any` ## enablePersistentCommentMode() Enable persistent comment mode. * **Signature**: `enablePersistentCommentMode()` * **Params**: none * **Returns**: `any` ## disablePersistentCommentMode() Disable persistent comment mode. * **Signature**: `disablePersistentCommentMode()` * **Params**: none * **Returns**: `any` ## enableCommentIndex() To show comment number. * **Signature**: `enableCommentIndex()` * **Params**: none * **Returns**: `any` ## disableCommentIndex() To hide comment number. * **Signature**: `disableCommentIndex()` * **Params**: none * **Returns**: `any` ## enablePopoverMode() To enable popover mode. * **Signature**: `enablePopoverMode()` * **Params**: none * **Returns**: `any` ## disablePopoverMode() To disable popover mode. * **Signature**: `disablePopoverMode()` * **Params**: none * **Returns**: `any` ## enablePopoverTriangleComponent() To show triangle in popover mode. * **Signature**: `enablePopoverTriangleComponent()` * **Params**: none * **Returns**: `any` ## disablePopoverTriangleComponent() To hide triangle in popover mode. * **Signature**: `disablePopoverTriangleComponent()` * **Params**: none * **Returns**: `any` ## enableDialogOnHover() To enable dialog on hover. * **Signature**: `enableDialogOnHover()` * **Params**: none * **Returns**: `any` ## disableDialogOnHover() To disable dialog on hover. * **Signature**: `disableDialogOnHover()` * **Params**: none * **Returns**: `any` ## enableDialogOnTargetElementClick() To enable feature to show dialog on target element click. * **Signature**: `enableDialogOnTargetElementClick()` * **Params**: none * **Returns**: `any` ## disableDialogOnTargetElementClick() To disable feature to show dialog on target element click. * **Signature**: `disableDialogOnTargetElementClick()` * **Params**: none * **Returns**: `any` ## enablePriority() To enable feature to set priority on comments. * **Signature**: `enablePriority()` * **Params**: none * **Returns**: `any` ## disablePriority() To disable feature to set priority on comments. * **Signature**: `disablePriority()` * **Params**: none * **Returns**: `any` ## enableStatus() To enable the feature to set status on comments. * **Signature**: `enableStatus()` * **Params**: none * **Returns**: `any` ## disableStatus() To disable the feature to set status on comments. * **Signature**: `disableStatus()` * **Params**: none * **Returns**: `any` ## enableResolveButton() To enable the feature to show the resolve button. * **Signature**: `enableResolveButton()` * **Params**: none * **Returns**: `any` ## disableResolveButton() To disable the feature to show the resolve button. * **Signature**: `disableResolveButton()` * **Params**: none * **Returns**: `any` ## enableGhostComments() To enable the feature to show ghost comments. * **Signature**: `enableGhostComments()` * **Params**: none * **Returns**: `any` ## disableGhostComments() To disable the feature to show ghost comments. * **Signature**: `disableGhostComments()` * **Params**: none * **Returns**: `any` ## enableGhostCommentsIndicator() To enable the feature to show ghost comments message in comment dialog and comment sidebar. * **Signature**: `enableGhostCommentsIndicator()` * **Params**: none * **Returns**: `any` ## disableGhostCommentsIndicator() To disable the feature to show ghost comments message in comment dialog and comment sidebar. * **Signature**: `disableGhostCommentsIndicator()` * **Params**: none * **Returns**: `any` ## setCustomStatus() Sets custom status filters. * **Signature**: `setCustomStatus(statuses: CustomStatus[])` * **Params**: `statuses: CustomStatus[]` * **Returns**: `void` ## setCustomPriority() Sets custom priority filters. * **Signature**: `setCustomPriority(priorities: CustomPriority[])` * **Params**: `priorities: CustomPriority[]` * **Returns**: `void` ## setCustomCategory() Sets custom categories filters. * **Signature**: `setCustomCategory(categories: CustomCategory[])` * **Params**: `categories: CustomCategory[]` * **Returns**: `void` ## enableInboxMode() To enable inbox mode. * **Signature**: `enableInboxMode()` * **Params**: none * **Returns**: `any` ## disableInboxMode() To disable inbox mode. * **Signature**: `disableInboxMode()` * **Params**: none * **Returns**: `any` ## enableAutoCategorize() To enable auto categorize feature. * **Signature**: `enableAutoCategorize()` * **Params**: none * **Returns**: `any` ## disableAutoCategorize() To disable auto categorize feature. * **Signature**: `disableAutoCategorize()` * **Params**: none * **Returns**: `any` ## enableDarkMode() To enable dark mode in comments. * **Signature**: `enableDarkMode()` * **Params**: none * **Returns**: `any` ## disableDarkMode() To disable dark mode in comments. * **Signature**: `disableDarkMode()` * **Params**: none * **Returns**: `any` ## setContextProvider() Sets the comment context provider. * **Signature**: `setContextProvider(provider: (documentId: string, location?: any) => any)` * **Params**: `provider: (documentId: string, location?: any) => any` * **Returns**: `void` ## enableSuggestionMode() To enable suggestion mode. * **Signature**: `enableSuggestionMode()` * **Params**: none * **Returns**: `any` ## disableSuggestionMode() To disable suggestion mode. * **Signature**: `disableSuggestionMode()` * **Params**: none * **Returns**: `any` ## enableMobileMode() To enable mobile mode. * **Signature**: `enableMobileMode()` * **Params**: none * **Returns**: `any` ## disableMobileMode() To disable mobile mode. * **Signature**: `disableMobileMode()` * **Params**: none * **Returns**: `any` ## enableInlineCommentMode() To enable inline comment mode. * **Signature**: `enableInlineCommentMode()` * **Params**: none * **Returns**: `any` ## disableInlineCommentMode() To disable inline comment mode. * **Signature**: `disableInlineCommentMode()` * **Params**: none * **Returns**: `any` ## enableMinimap() To enable minimap. * **Signature**: `enableMinimap()` * **Params**: none * **Returns**: `any` ## disableMinimap() To disable minimap. * **Signature**: `disableMinimap()` * **Params**: none * **Returns**: `any` ## showCommentsOnDom() To show comments on DOM. * **Signature**: `showCommentsOnDom()` * **Params**: none * **Returns**: `any` ## hideCommentsOnDom() To hide comments on DOM. * **Signature**: `hideCommentsOnDom()` * **Params**: none * **Returns**: `any` ## enableCommentTool() To enable comment tool. * **Signature**: `enableCommentTool()` * **Params**: none * **Returns**: `any` ## disableCommentTool() To disable comment tool. * **Signature**: `disableCommentTool()` * **Params**: none * **Returns**: `any` ## setTotalMediaLength() To set total media length. * **Signature**: `setTotalMediaLength(totalMediaLength: number)` * **Params**: `totalMediaLength: number` * **Returns**: `void` ## onCommentAdd() To get documentId, location, and set context data when a comment is added. * **Signature**: `onCommentAdd()` * **Params**: none * **Returns**: `Observable` ## onCommentUpdate() To get data when a comment is updated. * **Signature**: `onCommentUpdate()` * **Params**: none * **Returns**: `Observable` ## addCommentOnSelectedText() To add a comment on selected text. * **Signature**: `addCommentOnSelectedText()` * **Params**: none * **Returns**: `void` ## enableSidebarUrlNavigation() To enable navigation when a comment is clicked in the sidebar. * **Signature**: `enableSidebarUrlNavigation()` * **Params**: none * **Returns**: `void` ## disableSidebarUrlNavigation() To disable navigation when a comment is clicked in the sidebar. * **Signature**: `disableSidebarUrlNavigation()` * **Params**: none * **Returns**: `void` ## enableSidebarButtonOnCommentDialog() To enable the sidebar button on the comment dialog. * **Signature**: `enableSidebarButtonOnCommentDialog()` * **Params**: none * **Returns**: `void` ## disableSidebarButtonOnCommentDialog() To disable the sidebar button on the comment dialog. * **Signature**: `disableSidebarButtonOnCommentDialog()` * **Params**: none * **Returns**: `void` ## onSidebarButtonOnCommentDialogClick() To detect a click on the sidebar button on the comment dialog. * **Signature**: `onSidebarButtonOnCommentDialogClick()` * **Params**: none * **Returns**: `Observable` ## enableReactions() To enable reactions in comments. * **Signature**: `enableReactions()` * **Params**: none * **Returns**: `void` ## disableReactions() To disable reactions in comments. * **Signature**: `disableReactions()` * **Params**: none * **Returns**: `void` ## setRecordings() To set allowed recordings in comments. * **Signature**: `setRecordings(allowedRecordings: string | string[])` * **Params**: `allowedRecordings: string | string[]` * **Returns**: `void` ## addManualComment() To add manual comment with context. * **Signature**: `addManualComment(config: ManualCommentAnnotationConfig)` * **Params**: `config: ManualCommentAnnotationConfig` * **Returns**: `void` ## addCommentOnElement() To manually add a comment on an element. * **Signature**: `addCommentOnElement(data: CommentOnElementConfig)` * **Params**: `data: CommentOnElementConfig` * **Returns**: `void` ## enablePrivateCommentMode() To enable private comment mode to add private comments. This mode can be enabled for admin users only. * **Signature**: `enablePrivateCommentMode()` * **Params**: none * **Returns**: `void` ## disablePrivateCommentMode() To disable private comment mode. * **Signature**: `disablePrivateCommentMode()` * **Params**: none * **Returns**: `void` ## enableScrollToComment() To enable scroll to comment. * **Signature**: `enableScrollToComment()` * **Params**: none * **Returns**: `void` ## disableScrollToComment() To disable scroll to comment. * **Signature**: `disableScrollToComment()` * **Params**: none * **Returns**: `void` ## enableUserMentions() To enable user mentions in comments. * **Signature**: `enableUserMentions()` * **Params**: none * **Returns**: `void` ## disableUserMentions() To disable user mentions in comments. * **Signature**: `disableUserMentions()` * **Params**: none * **Returns**: `void` ## setCommentSidebarFilters() To apply filters on comment sidebar. * **Signature**: `setCommentSidebarFilters(filters: any)` * **Params**: `filters: any` * **Returns**: `void` ## setPinCursorImage() To set custom cursor for comment. * **Signature**: `setPinCursorImage(imageString: string)` * **Params**: `imageString` * **Returns**: `void` ## enableCommentPinHighlighter() To enable comment pin highlighter. * **Signature**: `enableCommentPinHighlighter()` * **Params**: none * **Returns**: `void` ## disableCommentPinHighlighter() To disable comment pin highlighter. * **Signature**: `disableCommentPinHighlighter()` * **Params**: none * **Returns**: `void` ## enableDeleteOnBackspace() To enable deleting comment on backspace. * **Signature**: `enableDeleteOnBackspace()` * **Params**: none * **Returns**: `void` ## disableDeleteOnBackspace() To disable deleting comment on backspace. * **Signature**: `disableDeleteOnBackspace()` * **Params**: none * **Returns**: `void` ## enableHotkey() To enable hotkey. * **Signature**: `enableHotkey()` * **Params**: none * **Returns**: `void` ## disableHotkey() To disable hotkey. * **Signature**: `disableHotkey()` * **Params**: none * **Returns**: `void` ## createCustomListDataOnComment() To create custom list data on comment. * **Signature**: `createCustomListDataOnComment(customListDataOnComment)` * **Params**: `customListDataOnComment` * **Returns**: `void` ## createCustomListDataOnAnnotation() To create custom list data on annotations. * **Signature**: `createCustomListDataOnAnnotation(customChipDropdownData)` * **Params**: `customChipDropdownData` * **Returns**: `void` # null ## getOnlineUsersOnCurrentDocument() Subscribe to cursors of all online users who are either active or inactive on the current document. * **Signature**: `getOnlineUsersOnCurrentDocument: () => Observable` * **Params**: none * **Returns**: `Observable` ## setInactivityTime() This method sets the inactivity time in milliseconds. * **Signature**: `setInactivityTime: (milliseconds: number) => void;` * **Params**: `milliseconds: number` * **Returns**: `void` ## allowedElementIds() To allow cursors in specific elements only. * **Signature**: `allowedElementIds: (elementIds: string[]) => any` * **Params**: `elementIds: string[]` * **Returns**: `any` # null ## getLiveStateData() Retrieves live state data as an observable based on the provided ID. * **Signature**: `getLiveStateData(liveStateDataId?: string): Observable` * **Params**: `liveStateDataId?: string` * **Returns**: `Observable` ## setLiveStateData() Sets live state data for the provided ID and data. * **Signature**: `setLiveStateData(liveStateDataId: string, liveStateData: any): any` * **Params**: `liveStateDataId: string , liveStateData: any` * **Returns**: `any` ## enableSingleEditorMode() Enables the single editor mode with an optional configuration. * **Signature**: `enableSingleEditorMode(config?: SingleEditorConfig): void` * **Params**: `config?: SingleEditorConfig` * **Returns**: `void` ## disableSingleEditorMode() Disables the single editor mode. * **Signature**: `disableSingleEditorMode(): void` * **Params**: none * **Returns**: `void` ## isUserEditor() Checks if the current user is an editor. Returns an observable. * **Signature**: `isUserEditor(): Observable` * **Params**: none * **Returns**: `Observable` ## getEditor() Retrieves the current editor information. * **Signature**: `getEditor(): Observable` * **Params**: none * **Returns**: `Observable` ## setUserAsEditor() Sets the current user as an editor. * **Signature**: `setUserAsEditor(): void` * **Params**: none * **Returns**: `void` ## resetUserAccess() Resets the user access. * **Signature**: `resetUserAccess(): void` * **Params**: none * **Returns**: `void` ## singleEditorModeContainerIds() Disables elements inside specific elements only when single editor mode is on. * **Signature**: `singleEditorModeContainerIds(elementIds: string[]): void` * **Params**: `elementIds: string[]` * **Returns**: `void` ## enableAutoSyncState() Enables the autosync state feature. * **Signature**: `enableAutoSyncState(): void` * **Params**: none * **Returns**: `void` ## disableAutoSyncState() Disables the autosync state feature. * **Signature**: `disableAutoSyncState(): void` * **Params**: none * **Returns**: `void` ## requestEditorAccess() Initiates a request for editor access. * **Signature**: `requestEditorAccess(): Observable` * **Params**: none * **Returns**: `Observable` ## isEditorAccessRequested() Checks if editor access has been requested. * **Signature**: `isEditorAccessRequested(): Observable<{ requestStatus: string, requestedBy: User } | null>` * **Params**: none * **Returns**: `Observable<{ requestStatus: string, requestedBy: User } | null>` ## acceptEditorAccessRequest() Accepts an editor access request. * **Signature**: `acceptEditorAccessRequest(): void` * **Params**: none * **Returns**: `void` ## rejectEditorAccessRequest() Rejects an editor access request. * **Signature**: `rejectEditorAccessRequest(): void` * **Params**: none * **Returns**: `void` ## cancelEditorAccessRequest() Cancels an editor access request. * **Signature**: `cancelEditorAccessRequest(): void` * **Params**: none * **Returns**: `void` ## editCurrentTab() Edits the current tab. * **Signature**: `editCurrentTab(): void` * **Params**: none * **Returns**: `void` ## setEditorAccessTimeout() Sets a timeout for editor access. (in milliseconds) * **Signature**: `setEditorAccessTimeout(timeout: number): void` * **Params**: `timeout: number` * **Returns**: `void` ## enableEditorAccessTransferOnTimeOut() Enables the transfer of editor access on timeout. * **Signature**: `enableEditorAccessTransferOnTimeOut(): void` * **Params**: none * **Returns**: `void` ## disableEditorAccessTransferOnTimeOut() Disables the transfer of editor access on timeout. * **Signature**: `disableEditorAccessTransferOnTimeOut(): void` * **Params**: none * **Returns**: `void` ## enableDefaultSingleEditorUI() Enables the default UI for single editor mode. * **Signature**: `enableDefaultSingleEditorUI(): void` * **Params**: none * **Returns**: `void` ## disableDefaultSingleEditorUI() Disables the default UI for single editor mode. * **Signature**: `disableDefaultSingleEditorUI(): void` * **Params**: none * **Returns**: `void` # null ## setMaxDays() To set maximum days within the notification tool and notification element. * **Signature**: `setMaxDays(days)` * **Params**: `days` * **Returns**: void # null ## getOnlineUsersOnCurrentDocument() Subscribe to a list of all online users who are either active or inactive on the current document. You can also use this find how many users are online on the current document and show them custom messages. Example: ```jsx const presenceElement = client.getPresenceElement(); presenceElement.getOnlineUsersOnCurrentDocument(); ``` * **Signature**: `getOnlineUsersOnCurrentDocument: () => Observable` * **Params**: none * **Returns**: `Observable` ## setInactivityTime() By default if the user is inactive for >5 minutes, we mark them offline. By inactive we mean they haven't moved their mouse or haven't made any keyboard event. You can configure this default threshold using this method. Example: ```jsx const presenceElement = client.getPresenceElement(); presenceElement.setInactivityTime(); ``` * **Signature**: `setInactivityTime: (milliseconds: number) => void` * **Params**: `milliseconds: number` * **Returns**: `void` ## enableFollowAlongMode() This method enables Follow Along Mode. Example: ```jsx const presenceElement = client.getPresenceElement(); presenceElement.enableFollowAlongMode(); ``` * **Signature**: `enableFollowAlongMode: (useHistoryAPI: boolean) => any` * **Params**: `useHistoryAPI: boolean` * **Returns**: `any` ## disableFollowAlongMode() This method disables Follow Along Mode. Example: ```jsx const presenceElement = client.getPresenceElement(); presenceElement.disableFollowAlongMode(); ``` * **Signature**: `disableFollowAlongMode: () => any` * **Params**: none * **Returns**: `any` # null ## initRecording() This method initializes recording. Example: ```jsx const recorderElement = client.getRecorderElement(); recorderElement.initRecording(type: string, panelId?: string); ``` * **Signature**: `(type: string, panelId?: string) => any` * **Params**: `type: string, panelId?: string` * **Returns**: `any` ## onRecordedData() This method listens to recorded data. Example: ```jsx const recorderElement = client.getRecorderElement(); recorderElement.onRecordedData((id,tag) => { console.log(id,tag) }); ``` * **Signature**: `() => Observable` * **Params**: none * **Returns**: `any` # null ## enableRewriter() This method enables the rewriter. Example: ```jsx const rewriterElement = client.getRewriterElement(); rewriterElement.enableRewriter(); ``` * **Signature**: `enableRewriter() => void` * **Params**: none * **Returns**: `void` ## disableRewriter() This method disables the rewriter. Example: ```jsx const rewriterElement = client.getRewriterElement(); rewriterElement.disableRewriter(); ``` * **Signature**: `disableRewriter() => void` * **Params**: none * **Returns**: void # null ## enableLiveSelection() This method enables live selection mode. Example: ```jsx const liveSelectionElement = client.getSelectionElement(); liveSelectionElement.enableLiveSelection(); ``` * **Signature**: `enableLiveSelection() => void` * **Params**: none * **Returns**: `void` ## disableLiveSelection() This method disables live selection mode. Example: ```jsx const liveSelectionElement = client.getSelectionElement(); liveSelectionElement.disableLiveSelection(); ``` * **Signature**: `disableLiveSelection() => void` * **Params**: none * **Returns**: `void` # null ## initConfig() Used to set up initial configurations for the Velt SDK. * **Signature**: `initConfig(apiKey: string, config?: Config)` * **Params**: `apiKey: string, config?: Config` * **Returns**: none ## identify() Used to authenticate the client's user with the Velt SDK. * **Signature**: `identify(user: User, userOptions?: UserOptions)` * **Params**: `user: User, userOptions?: UserOptions` * **Returns**: `Promise` ## setDocumentId() Tell us the unique ID of the current document/resource on which you want to enable collaboration. * **Signature**: `setDocumentId(id: string)` * **Params**: `id: string` * **Returns**: none ## unsetDocumentId() You can unset the Document Id to pause the Velt SDK functions. * **Signature**: `unsetDocumentId()` * **Params**: none * **Returns**: none ## setLocation() Tell us the custom params of the current document/resource to identify sub document inside a document. * **Signature**: `setLocation(params: Location, appendLocation?: boolean)` * **Params**: `params: Location, appendLocation?: boolean` * **Returns**: none ## removeLocation() To remove location from a User. * **Signature**: `removeLocation(location?: Location)` * **Params**: `location?: Location` * **Returns**: none ## setScrollableElementsIds() Tell us about the scrollable document ids to keep track on its scroll changes. * **Signature**: `setScrollableElementsIds(ids: string[])` * **Params**: `ids: string[]` * **Returns**: none ## removeScrollableElementsIds() To remove document params from a User. * **Signature**: `removeScrollableElementsIds()` * **Params**: none * **Returns**: none ## getPresenceElement() Get the Presence Element Object to access the raw presence data. * **Signature**: `getPresenceElement()` * **Params**: none * **Returns**: `PresenceElement` ## getCursorElement() Get the Cursor Element Object to access the raw cursor data. * **Signature**: `getCursorElement()` * **Params**: none * **Returns**: `CursorElement` ## getCommentElement() Get the Comment Element Object to access the raw comment data. * **Signature**: `getCommentElement()` * **Params**: none * **Returns**: `CommentElement` ## getTagElement() Get the Tag Pin Annotation Object to access the raw tag data. * **Signature**: `getTagElement()` * **Params**: none * **Returns**: `TagElement` ## getSelectionElement() Get the Selection Object to enable/disable the feature. * **Signature**: `getSelectionElement()` * **Params**: none * **Returns**: `SelectionElement` ## getRecorderElement() Get the Recorder Object. * **Signature**: `getRecorderElement()` * **Params**: none * **Returns**: `RecorderElement` ## getContactElement() Get the Contact Object. * **Signature**: `getContactElement()` * **Params**: none * **Returns**: `ContactElement` ## getRewriterElement() Get the Rewriter Object. * **Signature**: `getRewriterElement()` * **Params**: none * **Returns**: `RewriterElement` ## getLiveStateSyncElement() Get the LiveStateSync Object. * **Signature**: `getLiveStateSyncElement()` * **Params**: none * **Returns**: `LiveStateSyncElement` ## getArrowElement() Get the Arrow Object. * **Signature**: `getArrowElement()` * **Params**: none * **Returns**: `ArrowElement` ## signOutUser() To sign out a user. * **Signature**: `signOutUser()` * **Params**: none * **Returns**: `any` ## disableFeatures() Provide a list of features to disable. Provide an empty array to enable all the features. * **Signature**: `disableFeatures(features: Array)` * **Params**: `features: Array` * **Returns**: none ## addLocation() Add location to show comments, tags, recorders etc. for provided location also. * **Signature**: `addLocation(location: any)` * **Params**: `location: any` * **Returns**: none ## isUserAllowed\$() To check if user is allowed in provided document or not. * **Signature**: `isUserAllowed$()` * **Params**: none * **Returns**: `Observable` ## getUserRole\$() To get user role in provided document. * **Signature**: `getUserRole$()` * **Params**: none * **Returns**: `Observable` ## isPlanExpired\$() To check if plan is expired or not. * **Signature**: `isPlanExpired$()` * **Params**: none * **Returns**: `Observable` ## inviteUsers() To invite a list of users to the document. * **Signature**: `inviteUsers(documentUsers: Array)` * **Params**: `documentUsers: Array` * **Returns**: none ## removeVeltContent() To remove Velt specific content from provided html content. * **Signature**: `removeVeltContent(htmlContent: string)` * **Params**: `htmlContent: string` * **Returns**: `string` ## injectCustomCss() To inject custom CSS. * **Signature**: `injectCustomCss(customCss: CustomCss)` * **Params**: `customCss: CustomCss` * **Returns**: none ## setLanguage() To set the language. * **Signature**: `setLanguage(language: string)` * **Params**: `language: string` * **Returns**: none ## setTranslations() To set the translations for the language. * **Signature**: `setTranslations(language: string, translations: { [key: string]: string })` * **Params**: `language: string, translations: { [key: string]: string }` * **Returns**: none ## enableAutoTranslation() To enable auto translation. * **Signature**: `enableAutoTranslation()` * **Params**: none * **Returns**: none ## disableAutoTranslation() To disable auto translation. * **Signature**: `disableAutoTranslation()` * **Params**: none * **Returns**: none ## getVeltInitState() Subscribe to detect whether Velt is initialized. * **Signature**: `getVeltInitState()` * **Params**: none * **Returns**: `Observable` # React Hooks ## useIdentify() Hook that calls [client.identify()](/get-started/setup/authenticate) ```jsx import { useIdentify } from "@veltdev/react"; import { useEffect, useState } from "react"; export default function YourAuthComponent() { // Create the Velt user object let veltUser = { userId: "your-user-id", name: "John Smith" email: "jsmith@velt.dev", photoUrl: "https://i.pravatar.cc/304", organizationId: "theoffice", }; //identify Velt user useIdentify(veltUser) return (
Your Auth Template
) } ``` ## useSetDocumentId() Hook that calls [client.setDocumentId()](/get-started/setup/initialize-document) ```jsx import { useSetDocumentId } from '@veltdev/react'; export default function YourDocument() { useSetDocumentId("my-document-id") return (
Your Document Template
) } ``` ## useUnsetDocumentId() Hook that calls [client.unsetDocumentId()](https://docs.velt.dev/api-reference/api-methods/velt-client) ```jsx import { useUnsetDocumentId } from '@veltdev/react'; export default function YourDocument() { useUnsetDocumentId() return (
Your Document Template
) } ``` ## useSetLocation() Hook that calls [client.setLocation()](/key-concepts/locations/set-location) Hooks currently do not support automatic change detection in variables. ```jsx import { useSetLocation } from '@veltdev/react'; export default function YourDocument() { const handleSetLocation = () => { useSetLocation({ scene: "scene1" }) } return (
) } ``` ## useLiveStateSyncUtils() Hook that calls [client.getLiveStateSyncElement()](/realtime-collaboration/single-editor-mode/setup) ```jsx import { useLiveStateSyncUtils } from '@veltdev/react'; export default function YourDocument() { let liveStateSyncElement = useLiveStateSyncUtils() //Enable Single Editor Mode liveStateSyncElement?.enableSingleEditorMode(); return (
) } ``` ## useLiveStateData() Hook that calls [liveStateSyncElement.getLiveStateData()](/realtime-collaboration/live-state-sync/setup) ```jsx import { useLiveStateData, useSetLiveStateData} from '@veltdev/react'; export default function YourDocument() { //sets the live state data object useSetLiveStateData("myUniqueId", { "myKey": "hello world!", }) let data = useLiveStateData("myUniqueId") return (
{data?.myKey}
) } ``` ## useSetLiveStateData() Hook that calls [liveStateSyncElement.setLiveStateData()](/realtime-collaboration/live-state-sync/setup) ```jsx import { useLiveStateData, useSetLiveStateData} from '@veltdev/react'; export default function YourDocument() { useSetLiveStateData("myUniqueId", { "myKey": "hello world!", }) //gets the live state data object let data = useLiveStateData("myUniqueId") return (
{data?.myKey}
) } ``` ## useEditor() The `useEditor()` hook is used to call [liveStateSyncElement.getEditor()](/realtime-collaboration/single-editor-mode/setup) without having to handle the subscription. ```jsx import { useEditor} from '@veltdev/react'; export default function YourDocument() { let user = useEditor() console.log("Editor User Data: ", user) return (
Editor Email: {user.email} Editor Name: {user.name} Editor ID: {user.userId}
) } ``` ## useUserEditorState() Hook that calls [liveStateSyncElement.isUserEditor()](/realtime-collaboration/single-editor-mode/setup) ```jsx import { useUserEditorState} from '@veltdev/react'; export default function YourDocument() { let isEditor = useUserEditorState() console.log("Is User Editor?: ", isEditor) return (
Is User Editor?: {isEditor}
) } ``` ## useEditorAccessTimer() With the `useEditorAccessTimer` hook, you can get the Editor Access Timer state. ```jsx import { useEditorAccessTimer } from '@veltdev/react'; function YourReactComponent { const editorAccessTimer = useEditorAccessTimer(); useEffect(() => { if (editorAccessTimer?.state === 'completed') { onEditorAccessTimerCompleted(); } }, [editorAccessTimer]); const onEditorAccessTimerCompleted = () => { // If user is editor, make requester as editor acceptEditorAccessRequest(); // If user is requester, make it as editor setUserAsEditor(); } } ``` The `editorAccessTimer` class has the following schema: * `state`: `'idle'` | `'inProgress'` | `'completed' ` * `durationLeft`: `number` ## useEditorAccessRequestHandler() Hook that calls [liveStateSyncElement.isEditorAccessRequested()](/realtime-collaboration/single-editor-mode/setup) ```jsx import { useEditorAccessRequestHandler } from '@veltdev/react'; export default function YourDocument= () { const editorAccessRequested = useEditorAccessRequestHandler(); return (
Is Editor Access Being Requested? : {editorAccessRequested}
) } ``` ## usePresenceUtils() Hook that calls [client.getPresenceElement()](/realtime-collaboration/presence/customize-ui/create-your-own-ui) ```jsx import { usePresenceUtils } from '@veltdev/react'; export default function YourDocument() { let presenceElement = usePresenceUtils(); return (
) } ``` ## useCursorUtils() Hook that calls [client.getCursorElement()](/realtime-collaboration/cursors/customize-ui/create-your-own-ui) ```jsx import { useCursorUtils } from '@veltdev/react'; export default function YourDocument() { let cursorElement = useCursorUtils(); return (
) } ``` ## useCommentUtils() Hook that calls `client.getCommentElement()`. ```jsx import { useCommentUtils } from '@veltdev/react'; export default function YourDocument() { let commentElement = useCommentUtils(); return (
) } ``` ## useLiveSelectionUtils() Hook that calls `client.getLiveSelectElement()`. ```jsx import { useLiveSelectionUtils } from '@veltdev/react'; export default function YourDocument() { let liveSelectionElement = useLiveSelectionUtils() return (
) } ``` ## useRecorderUtils() Hook that calls `client.getRecorderElement()`. ```jsx import { useRecorderUtils } from '@veltdev/react'; export default function YourDocument() { let recorderElement = useRecorderUtils(); return (
) } ``` ## useContactUtils() Hook that calls `client.getContactElement()`. ```jsx import { useContactUtils } from '@veltdev/react'; export default function YourDocument() { let contactElement = useContactUtils(); return (
) } ``` ## useContactSelected() Hook that calls `client.onContactSelected()`. ```jsx import React, { useEffect } from 'react'; import { useContactUtils, useContactSelected } from '@veltdev/react'; function YourComponent() { const contactUtils = useContactUtils(); useEffect(() => { console.log('contactUtils: ', contactUtils); }, [contactUtils]); const onContactSelected = useContactSelected(); useEffect(() => { console.log('onContactSelected: ', onContactSelected); }, [onContactSelected]); return ( // Your component code ); } ``` ## useAIRewriterUtils() Hook that calls `client.getRewriterElement()`. ```jsx import { useAIRewriterUtils } from '@veltdev/react'; export default function YourDocument() { let AIRewriterElement = useAIRewriterUtils(); return (
) } ``` ## useHuddleUtils() Hook that calls `client.getHuddleElement()`. ```jsx import { useHuddleUtils } from '@veltdev/react'; export default function YourDocument() { let huddleElement = useHuddleUtils(); return (
) } ``` ## useCommentAnnotations() Hook that calls `commentElement.getAllCommentAnnotations()` See [CommentAnnotations Class Model](/api-reference/models/CommentAnnotation) ```jsx import { useCommentAnnotations } from '@veltdev/react'; export default function YourDocument() { let commentAnnotations = useCommentAnnotations('my-document-id', { id:'my-location-id',locationName:"MyLocationName"}) return (
{commentAnnotations.map(x =>
{x.annotationId}
)}
) } ``` ## useCommentModeState() Hook that calls [commentElement.onCommentModeChange()](/async-collaboration/comments/customize-behavior/event-handlers) ```jsx import { useCommentModeState } from '@veltdev/react'; export default function YourDocument() { let commentModeState = useCommentModeState() return (
Comment Mode is turned on: {commentModeState}
) } ``` ## useCommentAddHandler() Hook that calls [commentElement.onCommentAdd()](/async-collaboration/comments/customize-behavior/event-handlers) ```jsx import { useCommentAddHandler} from '@veltdev/react'; export default function YourDocument() { const commentAddEvent = useCommentAddHandler(); useEffect(() => { console.log('commentAddEvent', commentAddEvent); }, [commentAddEvent]); return (
) } ``` ## useCommentUpdateHandler() Hook that calls [commentElement.onCommentUpdate()](/async-collaboration/comments/customize-behavior/event-handlers) ```jsx import { useCommentUpdateHandler} from '@veltdev/react'; export default function YourDocument() { const commentUpdateEvent = useCommentUpdateHandler(); useEffect(() => { console.log('commentUpdateEvent', commentUpdateEvent); }, [commentUpdateEvent]); return (
) } ``` ## useCommentDialogSidebarClickHandler() Hook that calls [commentElement.onSidebarButtonOnCommentDialogClick()](/async-collaboration/comments/customize-behavior/general-controls) ```jsx import { useCommentDialogSidebarClickHandler} from '@veltdev/react'; export default function YourDocument() { const commentDialogSidebarClickEvent = useCommentDialogSidebarClickHandler(); useEffect(() => { console.log('CommentDialog Sidebar button clicked'); }, [commentDialogSidebarClickEvent]); return (
) } ``` ## useCursorUsers() Hook that calls [cursorElement.getOnlineUsersOnCurrentDocument()](/realtime-collaboration/cursors/customize-ui/create-your-own-ui) ```jsx import { useCursorUsers} from '@veltdev/react'; export default function YourDocument() { let cursorUsers = useCursorUsers() return (
Users: {cursorUsers.length}
) } ``` ## usePresenceUsers() Hook that calls [presenceElement.getOnlineUsersOnCurrentDocument()](/realtime-collaboration/presence/customize-ui/create-your-own-ui) ```jsx import { usePresenceUsers} from '@veltdev/react'; export default function YourDocument() { let presenceUsers = usePresenceUsers() return (
Users: {presenceUsers.length}
) } ``` ## useRecorderAddHandler() Hook that calls [recorderElement.onRecordedData()](/async-collaboration/recorder/customize-behavior/velt-recorder-control-panel) ```jsx import { useRecorderAddHandler} from '@veltdev/react'; export default function YourDocument() { const recorderAddEvent = useRecorderAddHandler(); useEffect(() => { console.log('recorderAddEvent', recorderAddEvent); }, [recorderAddEvent]); return (
) } ``` ## useCommentSelectionChange Hook that calls [commentElement.onCommentSelectionChange](/async-collaboration/comments/customize-behavior/event-handlers) ```jsx import React, { useEffect } from 'react'; import { useCommentSelectionChangeHandler } from '@veltdev/react'; function YourComponent() { const commentSelectionChangeEvent = useCommentSelectionChangeHandler(); useEffect(() => { console.log('commentSelectionChangeEvent', commentSelectionChangeEvent); }, [commentSelectionChangeEvent]); return ( <> Selected Comment: {commentSelectionChange.annotation.id} ); } ``` ## useVeltInitState Hook that calls [client.getVeltInitState()](/api-reference/api-methods/velt-client) ```jsx import { useVeltInitState } from '@veltdev/react'; function YourComponent() { const veltInitState = useVeltInitState(); useEffect(() => { console.log('Velt Init State:', veltInitState); if (veltInitState) { // Velt state is initialized, so user can perform any action here } }, [veltInitState]); } ``` ## useUnreadCommentCountByAnnotationId ```jsx import { useUnreadCommentCountByAnnotationId } from '@veltdev/react'; export default function YourDocument() { let unreadCommentCountByAnnotationId = useUnreadCommentCountByAnnotationId(annotationId); return (
Unread Comment Count By Annotation Id: {unreadCommentCountByAnnotationId}
) } ``` ## useUnreadCommentAnnotationCountOnCurrentDocument ```jsx import { useUnreadCommentAnnotationCountOnCurrentDocument } from '@veltdev/react'; export default function YourDocument() { let unreadCommentAnnotationCountOnCurrentDocument = useUnreadCommentAnnotationCountOnCurrentDocument(); return (
Unread Comment Annotations: {unreadCommentAnnotationCountOnCurrentDocument}
) } ``` ## useUnreadCommentCountOnCurrentDocument ```jsx import { useUnreadCommentCountOnCurrentDocument } from '@veltdev/react'; export default function YourDocument() { let unreadCommentCountOnCurrentDocument = useUnreadCommentCountOnCurrentDocument(); return (
Unread Commment Count on Current Document: {unreadCommentCountOnCurrentDocument}
) } ``` ## useUnreadCommentAnnotationCountByLocationId ```jsx import { useUnreadCommentAnnotationCountByLocationId } from '@veltdev/react'; export default function YourDocument() { let unreadCommentAnnotationCountByLocationId = useUnreadCommentAnnotationCountByLocationId(locationId); return (
Unread Comment Annotations By Location: {unreadCommentAnnotationCountByLocationId}
) } ``` ## useUnreadCommentCountByLocationId ```jsx import { useUnreadCommentCountByLocationId } from '@veltdev/react'; export default function YourDocument() { let unreadCommentCountByLocationId = useUnreadCommentCountByLocationId(locationId); return (
Unread Comments By Location: {unreadCommentCountByLocationId}
) } ``` # null ## AutocompleteItem Class | Property | Type | Optional | Description | | ----------- | ------ | -------- | -------------------------- | | id | string | No | Unique identifier | | name | string | No | Name of the item | | description | string | Yes | Optional description | | icon | object | Yes | Optional icon information | | icon.url | string | Yes | URL of the icon | | icon.svg | string | Yes | SVG representation of icon | | link | string | Yes | Link associated with item | # null ## `Comment` Class | Property | Type | Optional | Description | | ----------------------- | ------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | | `commentId` | number | No | Unique identifier for the comment pin annotation. Auto generated. | | `type` | 'text' \| 'voice' | No | This determines the comment content type. Default is 'text'. | | `commentText` | string | No | The actual text content of the comment. | | `commentHtml` | string | Yes | Same comment text but formatted in HTML. | | `replaceContentHtml` | string | Yes | HTML content to replace the comment text when user accepts the comment. | | `replaceContentText` | string | Yes | Text content to replace the comment text when user accepts the comment. | | `commentVoiceUrl` | string | Yes | URL of the voice recording for the comment, if available. | | `from` | User | No | The user who created this comment. | | `to` | User\[] | Yes | List of users that were @mentioned in this comment. | | `lastUpdated` | Date | Yes | Timestamp of when this comment was last updated. Auto generated. | | `editedAt` | any | Yes | Timestamp of when this comment was edited. Auto generated. | | `createdAt` | any | Yes | Timestamp of when this comment was created. Auto generated. | | `isEdited` | boolean | Yes | Whether the comment has been edited. Auto generated. | | `status` | 'added' \| 'updated' | No | Status of the comment indicating whether it was newly added or updated. | | `attachments` | [Attachment](#attachment-class-properties)\[] | No | List of attachments associated with the comment. | | `recorders` | [RecordedData](/api-reference/models/Recorder#recordeddata-class-properties)\[] | No | List of recorded data associated with the comment. | | `reactionAnnotationIds` | string\[] | No | List of annotation IDs for reactions to the comment. | | `taggedUserContacts` | [AutocompleteUserContactReplaceData](#autocompleteusercontactreplacedataclassproperties)\[] | No | List of users that were @mentioned in this comment. This contains addition metadata that is used to display the @mention in the UI. | | `customList` | [AutocompleteReplaceData](#autocompletereplacedataclassproperties)\[] | No | List of custom list items added to the comment. | | `isDraft` | boolean | No | Whether the comment is in draft state. | ## `AutocompleteUserContactReplaceData` Class | Property | Type | Optional | Description | | --------- | ------ | -------- | ------------------------------------------------------------------ | | `text` | string | No | The text displayed in the comment that represents the tagged user. | | `userId` | string | No | The user ID of the tagged user. | | `contact` | User | Yes | The user object of the tagged user. | ## `AutocompleteReplaceData` Class | Property | Type | Optional | Description | | -------- | ---------------- | -------- | ------------------------------------------------------------------ | | `text` | string | No | The text displayed in the comment that represents the custom item. | | `custom` | AutocompleteItem | No | The custom item object associated with this text. | ## `AutocompleteItem` Class Properties | Property | Type | Optional | Description | | ------------- | -------------------------------- | -------- | ----------------------------------------------------------------------- | | `id` | string | No | Unique identifier for the autocomplete item. | | `name` | string | No | Name or label of the autocomplete item. | | `description` | string | Yes | Additional description of the autocomplete item. | | `icon` | `{ url?: string, svg?: string }` | Yes | Icon associated with the autocomplete item. Can be a URL or SVG string. | | `link` | string | Yes | Optional link associated with the autocomplete item. | ## `AutocompleteData` Class | Property | Type | Optional | Description | | ------------- | -------------------------------- | -------- | ----------------------------------------------------------------------------- | | `hotkey` | string | No | The hotkey or trigger for this autocomplete data. | | `description` | string | Yes | Optional description of the autocomplete data. | | `type` | 'custom' \| 'contact' \| 'group' | No | The type of autocomplete data. Default is 'custom'. | | `data` | AutocompleteItem\[] | No | An array of AutocompleteItem objects containing the actual autocomplete data. | ## `Attachment` Class | Property | Type | Optional | Description | | -------------------------- | ------ | -------- | ----------------------------------------------------- | | `attachmentId` | number | No | Unique identifier for the attachment. Auto-generated. | | `name` | string | Yes | File name of the attachment. | | `size` | number | Yes | File size of the attachment. | | `type` | string | Yes | File type of the attachment. | | `url` | string | Yes | Download URL of the attachment. | | `thumbnail` | string | Yes | Thumbnail image in base64 format. | | `thumbnailWithPlayIconUrl` | string | Yes | URL of the thumbnail with a play icon overlay. | | `metadata` | any | Yes | Additional metadata of the attachment. | | `mimeType` | any | Yes | MIME type of the attachment. | # CommentAnnotation ## `CommentAnnotation` Class | Property | Type | Optional | Description | | ------------------------- | ------------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------- | | `annotationId` | string | No | Unique identifier for the comment pin annotation. Auto generated. | | `comments` | [Comment](/api-reference/models/Comment)\[] | No | The list of all comments part of this annotation. | | `commentCategories` | [CustomCategory](#customcategory-interface-properties)\[] | No | The list of categories that this comment pin annotation belongs to. | | `from` | User | No | The user who created this comment pin annotation. | | `color` | string | Yes | Color used for the comment pin annotation. | | `resolved` | boolean | Yes | Whether the comment annotation is marked resolved. Deprecated. | | `inProgress` | boolean | Yes | Whether the comment annotation is marked as in progress. Deprecated. | | `lastUpdated` | any | Yes | Timestamp when the comment annotation was last updated. Auto generated. | | `createdAt` | any | Yes | Timestamp when the comment annotation was created. Auto generated. | | `position` | CursorPosition \| null | Yes | Cursor position relative to the comment annotation. | | `locationId` | number \| null | Yes | Unique location id generated from provided location. | | `location` | Location \| null | Yes | Set location to identify user on sub document. | | `type` | string | Yes | Type of the comment annotation. | | `selectAllContent` | boolean | Yes | If true, sets text comment annotation on all the text content. | | `approved` | boolean | Yes | Whether the comment annotation is approved. | | `status` | [CustomStatus](#customstatus-interface-properties) | No | Status of the comment annotation. Default: [CommentAnnotationStatusMap.OPEN](#default-status-object) | | `annotationIndex` | number | Yes | Index of current annotation in the list. | | `pageInfo` | [PageInfo](/api-reference/models/PageInfo) | Yes | Page information related to the comment annotation. | | `assignedTo` | User | Yes | User to whom the comment annotation is assigned. | | `priority` | [CustomPriority](#custompriority-interface-properties) | Yes | Priority level of the comment annotation. | | `ghostComment` | GhostComment \| null | Yes | Placeholder for a non-existing comment. | | `context` | any | Yes | Custom context data provided by the user. | | `resolvedByUserId` | string | Yes | ID of the user who resolved the comment. | | `subscribedUsers` | [CommentAnnotationSubscribedUsers](#commentannotationsubscribedusers-class-properties) | Yes | Users who explicitly subscribe to the comment. | | `unsubscribedUsers` | [CommentAnnotationUnsubscribedUsers](#commentannotationunsubscribedusers-class-properties) | Yes | Users who explicitly unsubscribe to the comment. | | `multiThreadAnnotationId` | string | Yes | This is the ID of the multithread annotation group it belongs to, if this was created when multithread mode was on. | | `isDraft` | boolean | Yes | Indicates if the comment annotation is in draft state. | | `customList` | [CustomAnnotationDropdownItem](#customannotationdropdownitem)\[] | Yes | Custom list of items for the comment annotation. | ## `CommentAnnotationSubscribedUsers` Class | Property | Type | Optional | Description | | | ------------ | -------- | -------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `userIdHash` | string | No | The user ID of the subscribed user. | | | `user` | User | No | The user object of the subscribed user. | | | `type` | 'manual' | 'auto' | No | Manual: if the user used the UI option to subscribe; Auto: When the system automatically adds the user to the subscribed list. eg: when the user creates a comment annotation. | ## `CommentAnnotationUnsubscribedUsers` Class | Property | Type | Optional | Description | | | ------------ | -------- | -------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `userIdHash` | string | No | The user ID of the unsubscribed user. | | | `user` | User | No | The user object of the unsubscribed user. | | | `type` | 'manual' | 'auto' | No | Manual: if the user used the UI option to unsubscribe; Auto: When the system automatically removes the user from the unsubscribed list. eg: when the comment where user was tagged is deleted. | ## `CustomFilter` Class | Property | Type | Optional | Description | | -------- | ------ | -------- | ---------------------------------------- | | `id` | string | No | Unique identifier for the custom filter. | | `color` | string | No | Color associated with the custom filter. | | `name` | string | No | Name or label of the custom filter. | ## `CustomPriority` Class | Property | Type | Optional | Description | | ------------ | ------ | -------- | -------------------------------------------- | | `id` | string | No | Unique identifier for the custom priority. | | `color` | string | No | Color associated with the custom priority. | | `name` | string | No | Name or label of the custom priority. | | `lightColor` | string | Yes | Light color variant for the custom priority. | ## `CustomStatus` Class | Property | Type | Optional | Description | | ------------ | ---------- | -------- | --------------------------------------------------------- | | `id` | string | No | Unique identifier for the custom status. | | `color` | string | No | Color associated with the custom status. | | `name` | string | No | Name or label of the custom status. | | `type` | StatusType | No | Type of the status (`default`, `ongoing`, or `terminal`). | | `lightColor` | string | Yes | Light color for the custom status. | | `svg` | string | Yes | Raw SVG string for the custom status. | | `iconUrl` | string | Yes | URL to an icon image for the custom status. | ## `CustomCategory` Class | Property | Type | Optional | Description | | -------- | ------ | -------- | ------------------------------------------ | | `id` | string | No | Unique identifier for the custom category. | | `color` | string | No | Color associated with the custom category. | | `name` | string | No | Name or label of the custom category. | ## CustomAnnotationDropdownData Represents the configuration for a custom annotation dropdown. | Property | Type | Description | | ----------- | ---------------------------------------------------------------- | ------------------------------------------------------------ | | type | `multi` \| `single` | The type of the custom annotation dropdown. | | placeholder | string | The placeholder text for the dropdown. Defaults to 'Select'. | | data | [CustomAnnotationDropdownItem](#customannotationdropdownitem)\[] | An array of dropdown items. | ## CustomAnnotationDropdownItem Represents an item in a custom annotation dropdown. | Property | Type | Description | | -------- | ------ | -------------------------------------------- | | id | string | The unique identifier for the dropdown item. | | label | string | The display text for the dropdown item. | ## Default Status Object The default status object is defined in the `CommentAnnotationStatusMap` constant. It includes three predefined statuses: OPEN, IN\_PROGRESS, and RESOLVED. Each status is an object with the following structure: ```js { OPEN: { id: 'OPEN', name: 'Open', color: '#625DF5', lightColor: '#E7E8FA', type: 'default', svg: ` ` }, IN_PROGRESS: { id: 'IN_PROGRESS', name: 'In Progress', color: '#ECB000', lightColor: '#FEFCEA', type: 'ongoing', svg: ` ` }, RESOLVED: { id: 'RESOLVED', name: 'Resolved', color: '#00C48C', lightColor: '#E7FAF2', type: 'terminal', svg: ` ` }, } ``` # CommentSelectionChangeData ## `CommentSelectionChangeData` Class | Property | Type | Optional | Description | | ------------ | ----------------- | -------- | -------------------------------------- | | `selected` | boolean | Yes | Whether a comment is selected | | `annotation` | CommentAnnotation | Yes | Object data of the selected annotation | # CommentSidebarConfig ## `FilterTypeConfig` Class | Property | Type | Optional | Description | | ---------------- | ------- | -------- | ------------------------------------------------------- | | `name` | string | Yes | The name of the filter type. | | `enable` | boolean | Yes | Enables or disables the filter type. | | `multiSelection` | boolean | Yes | Allows multiple selections if set to true. | | `enableGrouping` | boolean | Yes | Enables grouping within the filter type if set to true. | ## `CommentSidebarFilterConfig` Class | Property | Type | Optional | Description | | ------------- | ---------------- | -------- | ------------------------------------------- | | `location` | FilterTypeConfig | Yes | Configuration for the location filter type. | | `people` | FilterTypeConfig | Yes | Configuration for the people filter type. | | `priority` | FilterTypeConfig | Yes | Configuration for the priority filter type. | | `category` | FilterTypeConfig | Yes | Configuration for the category filter type. | | `commentType` | FilterTypeConfig | Yes | Configuration for the comment type filter. | | `version` | FilterTypeConfig | Yes | Configuration for the version filter type. | ## `CommentSidebarGroupConfig` Class | Property | Type | Optional | Description | | -------- | ------- | -------- | ----------------------------- | | `enable` | boolean | Yes | Enables or disables grouping. | | `name` | string | Yes | The name of the group. | ## `CommentSidebarFilters` Class | Property | Type | Optional | Description | | ---------- | ----------- | -------- | ----------------------------------------------------------------------- | | `location` | Location\[] | Yes | Array of `Location` objects for the location filters. | | `people` | Object\[] | Yes | Array of objects with `userId`, `email`, and `name` for people filters. | | `priority` | string\[] | Yes | Array of priority filters. | | `status` | string\[] | Yes | Array of status filters. | | `category` | string\[] | Yes | Array of category filters. | | `version` | Object\[] | Yes | Array of objects with `id` and optional `name` for version filters. | # CommentSidebarCustomActionEventData ## `CommentSidebarCustomActionEventData` Class | Property | Type | Optional | Description | | -------------------- | ------------------------------------------- | -------- | --------------------------------------------------------------------------- | | `actions` | CommentSidebarCustomActionsState | No | Map of custom action button IDs and their states | | `data` | CommentAnnotation\[] | No | List of all unfiltered CommentAnnotations available in the comments sidebar | | `unreadDataMap` | `{ [commentAnnotationId: string]: number }` | No | Map of comment annotation id and the number of unread comments it has | | `systemFilteredData` | CommentAnnotation\[] | No | List of filtered CommentAnnotations based on system filters | ## `CommentSidebarCustomActionsState` Class | Property | Type | Optional | Description | | --------------- | ------- | -------- | ---------------------------------------------------- | | `[key: string]` | boolean | No | Custom Action Button ID you defined in the wireframe | # CommentSidebarData ## `CommentSidebarData` Class | Property | Type | Optional | Description | | ------------- | -------------------- | -------- | ----------------------------------------------- | | `groupId` | string | Yes | ID of the group. Defaults to 'others' | | `groupName` | string | Yes | Name of the group. Defaults to 'Others' | | `isExpanded` | boolean | Yes | Whether the group is expanded. Defaults to true | | `annotations` | CommentAnnotation\[] | No | List of CommentAnnotations in the group | ## `Options` Class | Property | Type | Optional | Description | | ---------- | ------- | -------- | ------------------------------------------- | | `grouping` | boolean | Yes | Whether to group the data. Defaults to true | # Velt Client Config ## `Config` Class Properties | Property | Type | Optional | Default | Description | | ----------------------- | -------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------ | | `urlAllowList` | string\[] | Yes | All pages | Restricts Velt features to specific pages by specifying partial URL strings. | | `featureAllowList` | FeatureType\[] | Yes | All features | Only allows the provided Velt features to run. | | `userPlanAllowList` | string\[] | Yes | All users | Restricts Velt features to specific user plans. | | `userIdAllowList` | string\[] | Yes | All users | Restricts Velt features to specific users. | | `usePrefersColorScheme` | boolean | Yes | - | If set to true, listens to changes on the `prefers-color-scheme` media query to set the global theme of Velt components. | # ContactListScopeForOrganizationUsers ```jsx export enum ContactListScopeForOrganizationUsers { ALL = 'all', // Show all the contacts ORGANIZATION = 'organization', // Show organization contacts. ORGANIZATION_USER_GROUP = 'organizationUserGroup', // Show organization user groups. DOCUMENT = 'document', // Show document contacts. } ``` # CursorUser ## `CursorUser` Class Properties: | Property | Type | Optional | Description | | -------------- | ---------------------- | -------- | --------------------------------------------------------------------------------------- | | `userId` | string | No | Unique user identifier that you use to identify your user. | | `name` | string | Yes | Your user's full name. Default: Random avatar name. | | `email` | string | Yes | Your user's email address. | | `photoUrl` | string | Yes | Your user's display picture URL. Default: Random avatar image. | | `comment` | string | Yes | Short comment that user can add to their live cursor. | | `onlineStatus` | string | No | User's online status (active, inactive, offline). Auto generated. | | `color` | string | Yes | A random color assigned to the user for the session, used on avatar border/live cursor. | | `timestamp` | any | No | Server Timestamp. | | `type` | string | Yes | User type. | | `locationId` | number \| null | Yes | Unique location id from provided location. | | `location` | Location \| null | Yes | Location to identify user on sub document. | | `position` | CursorPosition \| null | Yes | User’s cursor position on their screen. | | `isReadOnly` | boolean | Yes | Indicates if user is readonly. | | `isAnonymous` | boolean | Yes | Indicates if user is anonymous and can only view comments. | # CustomCss ## `CustomCss` Class | Property | Type | Optional | Description | | -------- | ------------------ | -------- | --------------------------------------------------------------------- | | `type` | 'link' \| 'styles' | No | The type of custom CSS, either a link to a CSS file or inline styles. | | `value` | string | No | The value of the custom CSS, either a URL or CSS styles. | # CustomFilter ## `CustomFilter` Interface Properties | Property | Type | Optional | Description | | -------- | ------ | -------- | ---------------------------------------- | | `id` | string | No | Unique identifier for the custom filter. | | `color` | string | No | Color associated with the custom filter. | | `name` | string | No | Name or label of the custom filter. | ## `CustomPriority` Interface Properties | Property | Type | Optional | Description | | ------------ | ------ | -------- | -------------------------------------------- | | `id` | string | No | Unique identifier for the custom priority. | | `color` | string | No | Color associated with the custom priority. | | `name` | string | No | Name or label of the custom priority. | | `lightColor` | string | Yes | Light color variant for the custom priority. | ## `CustomStatus` Interface Properties | Property | Type | Optional | Description | | ------------ | ---------- | -------- | --------------------------------------------------------- | | `id` | string | No | Unique identifier for the custom status. | | `color` | string | No | Color associated with the custom status. | | `name` | string | No | Name or label of the custom status. | | `type` | StatusType | No | Type of the status (`default`, `ongoing`, or `terminal`). | | `lightColor` | string | Yes | Light color for the custom status. | | `svg` | string | Yes | Raw SVG string for the custom status. | | `iconUrl` | string | Yes | URL to an icon image for the custom status. | ## `CustomCategory` Interface Properties | Property | Type | Optional | Description | | -------- | ------ | -------- | ------------------------------------------ | | `id` | string | No | Unique identifier for the custom category. | | `color` | string | No | Color associated with the custom category. | | `name` | string | No | Name or label of the custom category. | # DocumentMetadata ## `DocumentMetadata` Class Properties | Property | Type | Description | | ------------------ | ------------------------------------------ | ------------------------------------------------ | | `clientDocumentId` | string | The document ID set by you. | | `documentId` | string | The document ID set by the SDK. | | `documentName` | string | Name of the document | | `pageInfo` | [PageInfo](/api-reference/models/PageInfo) | Additional information about the document's page | # EditorAccessTimer ## `EditorAccessTimer` Class Properties | Property | Type | Optional | Description | | -------------- | --------------------------------------- | -------- | ---------------------------------------------------------- | | `state` | `'idle' \| 'inProgress' \| 'completed'` | No | The state of the Editor Access Request timer | | `durationLeft` | `number` | Yes | Duration left for the editor access timer to be completed. | # null Feature Types Enum: ```jsx export enum Features { AREA = 'area', ARROW = 'arrow', AUDIO_HUDDLE = 'audioHuddle', COMMENT = 'comment', CURSOR = 'cursor', HUDDLE = 'huddle', LIVE_STATE_SYNC = 'liveStateSync', PRESENCE = 'presence', TAG = 'tag', RECORDER = 'recorder', REWRITER = 'rewriter', LIVE_SELECTION = 'liveSelection', } ``` # FlockOptions ## `FlockOptions` Class Properties | Property | Type | Optional | Description | | -------------------------- | ----------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `useHistoryAPI` | boolean | No | Indicates whether the application should use the HTML5 History API for navigation. | | `onNavigate` | (url: PageInfo) => void | Yes | A callback function that is called when navigation occurs. It takes a `PageInfo` object as its argument, which likely contains details about the new page. | | `disableDefaultNavigation` | boolean | No | If `true`, the application's default navigation handling is disabled, perhaps to be managed manually or by another system. | | `darkMode` | boolean | No | A flag indicating whether the application should display in dark mode, a display preference that may be more comfortable for users in low-light conditions. | # LiveStateData ## `LiveStateData` Class | Property | Type | Optional | Description | | ----------------- | ----------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- | | \`id | string | No | A unique identifier likely used for quick reference and indexing. It's an MD5 hash of `liveStateDataId`. | | `liveStateDataId` | string | No | A unique identifier for the state data being synced. | | `data` | string \| number \| boolean \| JSON | No | The actual data you want to synchronize across clients. | | `lastUpdated` | any | No | A timestamp or similar data indicating the last time the state data was updated. | | `updatedBy` | `User` | No | The user who last updated the state data. | | `tabId` | string \| null | Yes | An identifier that could be used to associate the state data with a specific tab or instance. | ## `SingleEditorLiveStateData` Class | Property | Type | Optional | Description | | --------------------- | -------------- | -------- | ------------------------------------------ | | `editor` | User \| null | Yes | The user who is currently editing, if any. | | `requestEditorAccess` | Object \| null | Yes | Details about a request for editor access. | | `tabId` | string \| null | Yes | The identifier of the tab, if applicable. | ## `requestEditorAccess` Class: | Property | Type | Optional | Description | | --------------------- | ---------------------------------------------------- | -------- | -------------------------------------------------------- | | `user` | User | No | The user requesting editor access. | | `requestedAt` | any | No | The timestamp when the access was requested. | | `status` | 'pending' \| 'accepted' \| 'rejected' \| 'cancelled' | No | The status of the access request. | | `editorAccessTimeout` | number | No | Timeout duration for the editor access. | | `tabId` | string \| null | Yes | The identifier of the tab related to the access request. | ## `SingleEditorConfig` Class | Property | Type | Optional | Description | | ----------------- | ------- | -------- | --------------------------------------------------------------------------------------------- | | `customMode` | boolean | Yes | Enables/disables custom mode. In custom mode, input elements are not disabled for the viewer. | | `singleTabEditor` | boolean | No | Enables/disables editor mode on a single tab only. | ## `UserEditorAccess` Class | Property | Type | Optional | Description | | ---------------------- | ------- | -------- | ----------------------------------------------------------- | | `isEditor` | boolean | Yes | Indicates whether the user has editor privileges. | | `isEditorOnCurrentTab` | boolean | Yes | Indicates whether the user is an editor on the current tab. | # null ## LiveStateDataMap Properties | Property | Type | Optional | Description | | ------------------------------- | ----------------------------------------------- | -------- | --------------------------------------------------------------------------------------- | | `custom` | `{ [liveStateDataId: string]: LiveStateData; }` | Yes | Map of all unique LiveStateData set by you on the given document. | | `default` | Object | Yes | Map of all unique LiveStateData set by the default editor on the given document. | | `default.singleEditor` | `SingleEditorLiveStateData` | | Part of `default`, representing single editor live state data. | | `default.autoSyncState` | Object | | Part of `default`, representing auto synchronization state. | | `default.autoSyncState.current` | `LiveStateData` | | Part of `autoSyncState`, current live state data. | | `default.autoSyncState.history` | `[liveStateDataId: string]: LiveStateData` | | Part of `autoSyncState`, map of historical live state data keyed by live state data ID. | # null ## `Location` Class Properties Here's the `Location` class information formatted as a Markdown table, including a column to indicate whether each field is optional and a note on the dynamic properties: | Property | Type | Optional | Description | | --------------- | ------- | -------- | ------------------------------------------------- | | `id` | string | No | Unique identifier for the location. | | `locationName` | string | Yes | Name of the location. | | `version` | Version | Yes | Version information provided by the user. | | `[key: string]` | any | Yes | Additional dynamic properties as key-value pairs. | ## Version Here's the `Version` class information formatted as a Markdown table, including a column to indicate whether each field is optional: | Property | Type | Optional | Description | | -------- | ------ | -------- | ---------------------------------- | | `id` | string | No | Unique identifier for the version. | | `name` | string | No | Name of the version. | # LocationMetadata ## `LocationMetadata` Class Properties | Property | Type | Optional | Description | | ------------ | ------------------ | -------- | ------------------------------------------------------------- | | `locationId` | number | Yes | Unique location id generated from client location information | | `location` | `Location` \| null | Yes | Location object provided by a client | # MediaPreviewConfig ## `MediaPreviewConfig` Class Properties | Property | Type | Optional | Description | | ---------------- | ----------- | -------- | --------------------------------- | | `audio` | Object | Yes | Configuration for audio preview | | `audio.enabled` | boolean | Yes | Whether audio preview is enabled | | `audio.deviceId` | string | Yes | Device ID for audio input | | `video` | Object | Yes | Configuration for video preview | | `video.enabled` | boolean | Yes | Whether video preview is enabled | | `video.deviceId` | string | Yes | Device ID for video input | | `screen` | Object | Yes | Configuration for screen preview | | `screen.enabled` | boolean | Yes | Whether screen preview is enabled | | `screen.stream` | MediaStream | Yes | MediaStream for screen sharing | # null ## `Notification` Class Properties | Property | Type | Optional | Description | | ------------------------------------ | ----------------------------------- | -------- | ----------------------------------------------------------------------------- | | `id` | `string` | No | Notification ID | | `notificationSource` | `string` | No | Notification source. e.g., 'comment', 'custom', etc. | | `actionType` | `string` | Yes | Action that triggered the notification. e.g., 'added' | | `isUnread` | `boolean` | Yes | Whether the notification is unread for the user | | `actionUser` | `User` | Yes | The user who triggered the action | | `timestamp` | `number` | Yes | Timestamp of the notification | | `displayHeadlineMessage` | `string` | Yes | The headline message of the notification | | `displayBodyMessage` | `string` | Yes | The body message of the notification | | `displayHeadlineMessageTemplate` | `string` | Yes | The template of the headline message | | `displayHeadlineMessageTemplateData` | `object` | Yes | The data used to fill the headline message template | | `forYou` | `boolean` | Yes | Whether the notification is for the current logged-in user | | `targetAnnotationId` | `string` | Yes | ID of the annotation that triggered the notification | | `notificationSourceData` | `any` | Yes | The data of the notification source. e.g., `CommentAnnotation` | | `metadata` | `NotificationMetadata` | Yes | Metadata for the current notification. e.g., `documentId` | | `notifyUsers` | `{ [emailHash: string]: boolean }` | Yes | Map of email hashes to boolean values indicating whether to notify the user | | `notifyUsersByUserId` | `{ [userIdHash: string]: boolean }` | Yes | Map of user ID hashes to boolean values indicating whether to notify the user | ## `displayHeadlineMessageTemplateData` Object Properties | Property | Type | Description | | --------------- | -------- | --------------------------------------- | | `actionUser` | `User` | The user who performed the action | | `recipientUser` | `User` | The user receiving the notification | | `actionMessage` | `string` | The message describing the action | | `project` | `string` | The project related to the notification | | `[key: string]` | `any` | Any additional custom properties | ## `NotificationMetadata` Properties | Property | Type | Optional | Description | | ---------------------- | ---------- | -------- | -------------------------------------------------- | | `apiKey` | `string` | Yes | Your API key | | `clientOrganizationId` | `string` | Yes | The organization ID that you set | | `organizationId` | `string` | Yes | The organization ID generated by us | | `clientDocumentId` | `string` | Yes | The document ID that you set | | `documentId` | `string` | Yes | The document ID generated by us | | `locationId` | `number` | Yes | The unique location ID | | `location` | `Location` | Yes | The location object | | `documentMetadata` | Object | Yes | Contains the complete document metadata object | | `organizationMetadata` | Object | Yes | Contains the complete organization metadata object | # PageInfo ## `PageInfo` Class Properties | Property | Type | Optional | Description | | ------------- | ------ | -------- | -------------------------------------- | | `url` | string | Yes | URL of the webpage | | `path` | string | Yes | Path of the webpage excluding base url | | `baseUrl` | string | Yes | Base URL (domain) of a webpage | | `title` | string | Yes | Title of the webpage | | `commentUrl` | string | Yes | Reference url of a comment annotation | | `recorderUrl` | string | Yes | Reference url of a recorder annotation | | `screenWidth` | number | Yes | User's screen width. Auto generated. | # PresenceUser ## `PresenceUser` Class Properties | Property | Type | Optional | Description | | ------------------ | ---------------- | -------- | ---------------------------------------------------------- | | `userId` | String | No | Unique user identifier | | `name` | String | Yes | User's full name (Default: Random avatar name) | | `email` | String | Yes | User's email address | | `photoUrl` | String | Yes | User's display picture URL (Default: Random avatar image) | | `onlineStatus` | String | No | Online status (active, inactive, offline) (Auto generated) | | `color` | String | Yes | Assigned color for the user (Auto generated) | | `timestamp` | Any | No | Server Timestamp | | `type` | String | Yes | User type | | `selections` | Any | Yes | User selections | | `documentParamsId` | Number, null | Yes | Deprecated unique document params ID | | `documentParams` | Object, null | Yes | Deprecated document params | | `locationId` | Number, null | Yes | Unique location ID | | `location` | `Location`, null | Yes | Location of user on sub document | | `isReadOnly` | Boolean | Yes | Indicates if user is readonly | | `isAnonymous` | Boolean | Yes | If user can only view comments (Anonymous) | | `pageInfo` | `PageInfo` | No | Information about the page | # null ## `RecorderConfig` Class | Property | Type | Optional | Description | | ----------------- | -------------------------------------------------------- | -------- | ------------------------------ | | `type` | `{ audio?: boolean, video?: boolean, screen?: boolean }` | No | Types of media to be recorded | | `recorderOptions` | MediaRecorderOptions | Yes | Options for the media recorder | ## `RecordedData` Class | Property | Type | Optional | Description | | -------------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------- | | `id` | string | No | Annotation ID of recorder annotation. | | `tag` | string | No | Recorder player tag containing recorder annotation id which can be added anywhere on the DOM. | | `type` | string | No | Type of recorded data. Possible values are 'audio', 'video', and 'screen'. | | `thumbnailUrl` | string | Yes | URL of the thumbnail image for the recorded data. | | `thumbnailWithPlayIconUrl` | string | Yes | URL of the thumbnail image with a play icon overlay. | | `videoUrl` | string | Yes | URL of the recorded video. | | `audioUrl` | string | Yes | URL of the recorded audio. | | `videoPlayerUrl` | string | Yes | URL of the hosted website to open video in a new tab. | | `getThumbnailTag` | function | No | A method that returns an HTML string for displaying the thumbnail with a link to the video player. | ### `getThumbnailTag` Method The `getThumbnailTag` method takes an optional `url` parameter and returns an HTML string. It creates an anchor tag linking to the `videoPlayerUrl` and embeds an image tag using either the provided `url`, `thumbnailWithPlayIconUrl`, or `thumbnailUrl` (in that order of preference). # RecorderAnnotation ## `RecorderAnnotation` Class Properties | Property | Type | Optional | Description | | | ----------------- | ------------- | -------- | ----------------------------------------------------------------------- | - | | `annotationId` | String | No | Unique identifier for the recorder annotation, automatically generated. | | | `from` | `User` | No | The user who created the recorder annotation. | | | `color` | String | Yes | Color used for the annotation. | | | `lastUpdated` | Any | Yes | Timestamp of the last update, automatically generated. | | | `locationId` | Number | Yes | Unique location ID from provided location. | | | `location` | `Location` | Yes | Location to identify user on sub document. | | | `type` | String | Yes | Type of annotation. | | | `recordingType` | String | No | Type of recording for the annotation. | | | `mode` | String | No | Mode of the recorder annotation, 'floating' or 'thread'. | | | `approved` | Boolean | Yes | Indicates if the annotation is approved. | | | `attachment` | Attachment | Yes | Attachment for recorded media. Deprecated. | | | `attachments` | Attachment\[] | No | List of attachments for the annotation. | | | `annotationIndex` | Number | Yes | Index of the annotation in a list. | | | `pageInfo` | PageInfo | Yes | Information about the page where the annotation is made. | | | `recordedTime` | Object | Yes | Recorded time details. | | | `transcription` | Transcription | Yes | Transcription of the recorded media. | | # RecorderData ## `RecorderDataTranscriptSegment` Class Properties | Property | Type | Optional | Description | | -------------------- | ------ | -------- | --------------------------------------- | | `startTime` | String | No | Start time of the transcription segment | | `endTime` | String | No | End time of the transcription segment | | `startTimeInSeconds` | Number | No | Start time of the segment in seconds | | `endTimeInSeconds` | Number | No | End time of the segment in seconds | | `text` | String | No | Transcribed text content of the segment | ## `RecorderDataTranscription` Class Properties | Property | Type | Optional | Description | | -------------------- | --------------------------------- | -------- | ---------------------------------------- | | `transcriptSegments` | `RecorderDataTranscriptSegment[]` | Yes | Array of transcription segments | | `vttFileUrl` | String | Yes | URL to the VTT format transcription file | | `contentSummary` | String | Yes | Summary of the transcribed content | ## `RecorderDataAsset` Class Properties | Property | Type | Optional | Description | | ----------------- | ---------------------------------- | -------- | ---------------------------------- | | `url` | String | No | URL to the recorded media | | `mimeType` | String | Yes | MIME type of the recorded media | | `fileName` | String | Yes | Name of the recorded file | | `fileSizeInBytes` | Number | Yes | Size of the recorded file in bytes | | `fileFormat` | 'mp3' \| 'mp4' \| 'webm' \| String | Yes | The format/extension of the file | | `thumbnailUrl` | String | Yes | URL to the thumbnail image | ## `RecorderData` Class Properties | Property | Type | Optional | Description | | --------------- | --------------------------- | -------- | ------------------------------------------------- | | `assets` | `RecorderDataAsset[]` | No | Array of recording assets with metadata | | `transcription` | `RecorderDataTranscription` | No | Transcription data including segments and summary | # RewriterAnnotation ## `RewriterAnnotation` Class Properties | Property | Type | Optional | Description | | ------------------------ | ----------------------- | -------- | ------------------------------------------------------------------------------------- | | `annotationId` | String | No | Unique identifier for the rewriter annotation, automatically generated. | | `from` | `User` | No | The user who created this rewriter annotation. | | `color` | String | Yes | Color used for the rewriter annotation. | | `lastUpdated` | Any | Yes | Timestamp when the rewriter annotation was last updated, automatically generated. | | `documentParamsId` | Number \| null | Yes | Unique document params ID, deprecated, use `locationId` instead. | | `documentParams` | `Location` \| null | Yes | Document params to identify user on sub document, deprecated, use `location` instead. | | `locationId` | Number \| null | Yes | Unique location ID generated from provided location. | | `location` | Location \| null | Yes | Set location to identify user on sub document. | | `type` | String | Yes | Type of annotation. | | `rewriterType` | String | No | Type of rewriter for the annotation, either 'generic' or 'copywriter'. | | `targetTextRange` | TargetTextRange \| null | Yes | Selected text range of rewriter annotation. | | `annotationIndex` | Number | Yes | Index of the current annotation in the list of annotations. | | `pageInfo` | `PageInfo` | Yes | Information about the page where the annotation is made. | | `selectedRewriterOption` | String | Yes | Selected rewriter option used in the annotation. | # SyncVideoPlayer ## `SyncVideoPlayer` Class Properties | Property | Type | Optional | Description | | ------------------ | -------------------- | -------- | ----------------------------------------------------- | | `playerId` | String | Yes | The identifier for the video player instance. | | `src` | String | Yes | The source URL of the video. | | `sources` | String\[] | Yes | An array of source URLs for the video. | | `lastUpdated` | Number | Yes | The timestamp of when the player was last updated. | | `lastUpdatedBy` | `User` | Yes | The user who last updated the player. | | `lastUpdatedEvent` | String | Yes | The name of the event that triggered the last update. | | `playerState` | SyncVideoPlayerState | No | The state object of the video player. | ## `SyncVideoPlayerState` Class Properties | Property | Type | Optional | Description | | ------------- | ------- | -------- | -------------------------------------------- | | `playing` | Boolean | Yes | Indicates if the video is currently playing. | | `currentTime` | Number | Yes | The current playback time of the video. | | `muted` | Boolean | Yes | Indicates if the video is muted. | | `volume` | Number | Yes | The volume level of the video. | | `speed` | Number | Yes | The playback rate of the video. | # null ## `Toast` Class Properties | Property | Type | Optional | Default Value | Description | | ---------- | -------------------- | -------- | ------------- | ------------------------------------------------------------------------ | | `id` | Number | Yes | None | A unique identifier for the toast notification. | | `message` | String | No | None | The message content displayed in the toast notification. | | `type` | 'success' \| 'error' | No | None | The type of toast notification, indicating success or error. | | `duration` | Number | Yes | 3000 | The length of time the toast notification is displayed, in milliseconds. | # null ## `Transcription` Class Properties | Property | Type | Optional | Description | | ------------------ | ------ | -------- | ----------------------------------------------------- | | `from` | User | No | The user who created the transcription. | | `lastUpdated` | Number | Yes | Timestamp of when the transcription was last updated. | | `transcriptedText` | String | Yes | The text that has been transcribed. | # null ## `User` Class Properties | Property | Type | Optional | Description | | ---------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | | `userId` | string | No | Unique user identifier used to identify your user. | | `name` | string | Yes | The full name of your user. Defaults to a random avatar name if not provided. | | `photoUrl` | string | Yes | The display picture URL of your user. Defaults to a random avatar image if not provided. | | `email` | string | Yes | Required for sending email or Slack notifications to users about comments and mentions. | | `plan` | string | Yes | The product plan the user is on. | | `organizationId` | string | Yes | Autogenerated organizationId based on the organizationId you provide. | | `clientorganizationId` | string | Yes | The original organizationId provided by you. | | `color` | string | Yes | A color assigned to the user for the current session, used for avatar border, live cursor, selection etc. | | `textColor` | string | Yes | Used in the text color of the user's intial when photoUrl is not present. | | `type` | string | Yes | The type of user. | | `isReadOnly` | boolean | Yes | Indicates if the user has read-only access. | | `isAnonymous` | boolean | Yes | Indicates if the user is anonymous and can only view comments. | | `isGuest` | boolean | Yes | Indicates if the user is a guest. | | `isAdmin` | boolean | Yes | Use this to set the user as an admin. You also need to ensure that the jwt token you generate also has this property set to true. | | `groupId` | string | Yes | \[DEPRECATED] A domain name or identifier used to cluster a group of users who work together. | | `clientGroupId` | string | Yes | \[DEPRECATED] The original groupId provided by the user. | | `initial` | string | Yes | First letter of the user's first name. | ## `UserOptions` Class Properties | Property | Type | Optional | Description | | ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------- | | `replaceContacts` | boolean | Yes | If set to true, it will replace the user's personal and group contacts with the ones provided. | | `authToken` | string | Yes | The authentication token of the user. | # UserContactSelectedPayload | Property | Type | Optional | Description | | ----------------------- | ----------- | -------- | ------------------------------------- | | `contact` | UserContact | No | Selected user contact details. | | `isOrganizationContact` | boolean | No | Is user part of organization contact. | | `isDocumentContact` | boolean | No | Is user part of document contact. | | `documentAccessType` | string | No | Document access type. | # UserContactUs ## `UserContactUs` Class Properties | Property | Type | Optional | Description | | ------------- | ---------------------------- | -------- | ------------------------------------------------ | | `id` | `string` | Yes | Unique identifier of the feedback. | | `apiKey` | `string` \| `null` | Yes | API key of the client. | | `emailId` | `string` | Yes | Email address of the feedback provider. | | `message` | `string` | Yes | Content of the user's feedback message. | | `from` | `User` \| `null` | Yes | User who submitted the feedback. | | `lastUpdated` | `any` | Yes | Timestamp of when the feedback was last updated. | | `metadata` | `DocumentMetadata` \| `null` | Yes | Metadata associated with the document. | | `pageInfo` | `PageInfo` | Yes | Information about the user's current page. | # UserFeedback ## `UserFeedback` Class Properties | Property | Type | Optional | Description | | ------------- | ---------------------------- | -------- | ------------------------------------------------ | | `id` | `string` | Yes | Unique identifier of the feedback. | | `apiKey` | `string` \| `null` | Yes | API key of the client. | | `emailId` | `string` | Yes | Email address of the feedback provider. | | `message` | `string` | Yes | Content of the user's feedback message. | | `from` | `User` \| `null` | Yes | User who submitted the feedback. | | `lastUpdated` | `any` | Yes | Timestamp of when the feedback was last updated. | | `metadata` | `DocumentMetadata` \| `null` | Yes | Metadata associated with the document. | | `pageInfo` | `PageInfo` | Yes | Information about the user's current page. | # Add Comment Annotations POST https://api.velt.dev/v1/commentannotations/add Use this API to add comment annotations to a document within an organization. * You can add comments on an elemement, text or page. * You can provide HTML or text content. * Additional filters can be applied using location IDs. # Endpoint `POST https://api.velt.dev/v1/commentannotations/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Location ID Location Name Target Element Element DOM Id Target Text. Provide this if you want to add comment annotation on the provided text content. Occurrence. Provide this if you want to add comment annotation on a text content. Select All Content. Provide this if you want to select and add comment annotation on the entire text content of the target elementId. Array of Comment Data Comment content in plain text string Comment content in HTML string User object from whom the comment is added Status Type Default Ongoing Terminal Light Color Raw SVG of the icon Icon URL User object to whom the comment is assigned Custom key/value metadata object Priority Priority ID Priority Color Priority Name Priority Light Color ## **Example Requests** #### Add comment annotation by organizationId, documentId and location ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "commentAnnotations": [ { "location": { "id": "yourLocationId", "locationName": "yourLocationName" }, "targetElement": { "elementId": "yourElementId", "targetText": "Your Target Text", "occurrence": 1, "selectAllContent": false }, "commentData": [ { "commentText": "Sample Comment", "commentHtml": "
Hello
", "from": { "userId": "yourUserId", "name": "yourUserName", "email": "yourUserEmail", } } ] } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Comment Annotation addition successfully.", "data": { "-O0mpUziLcBwzREvZKs6": { "success": true, "annotationId": "-O0mpUziLcBwzREvZKs6", "commentIds": [ 126535 ], "message": "Added Successfully" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Comment Annotation addition successful.", "data": { "annotationId": "yourAnnotationId", "commentIds": [ 333130 ] } } } ``` # Delete Comment Annotations POST https://api.velt.dev/v1/commentannotations/delete Use this API to delete comment annotations from a document within an organization. Additional filters can be applied using location IDs, annotation IDs, or user IDs. # Endpoint `POST https://api.velt.dev/v1/commentannotations/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Array of Location IDs Array of Annotation IDs Array of User IDs ## **Example Requests** #### 1. Delete annotations by organizationId and documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId" } } ``` #### 2. Delete annotations by organizationId, documentId and locationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ] } } ``` #### 3. Delete annotations by organizationId, documentId, locationIds and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "userIds": [ "yourUserId" ] } } ``` #### 4. Delete annotations by organizationId, documentId and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId" ] } } ``` #### 5. Delete annotations by organizationId, documentId and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ] } } ``` #### 6. Delete annotations by organizationId, documentId, locationIds and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ] } } ``` #### 7. Delete annotations by documentId. This will work if the document was created without an organization. ```JSON { "data": { "documentId": "yourDocumentId" } } ``` #### 8. Delete annotations by documentId and locationIds. This will work if the document was created without an organization. ```JSON { "data": { "documentId": "yourDocumentId", "locationIds": [ "locationx" ] } } ``` #### 9. Delete annotations by documentId and userIds. This will work if the document was created without an organization. ```JSON { "data": { "documentId": "yourDocumentId", "userIds": [ "yourUserId" ] } } ``` #### 10. Delete annotations by documentId and annotationIds. This will work if the document was created without an organization. ```JSON { "data": { "documentId": "yourDocumentId", "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ] } } ``` #### 11. Delete annotations by documentId, locationIds, and userIds. This will work if the document was created without an organization. ```JSON { "data": { "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "userIds": [ "yourUserId" ] } } ``` #### 12. Delete annotations by documentId, locationIds, and annotationIds. This will work if the document was created without an organization. ```JSON { "data": { "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Annotations deleted successfully.", "data": { "yourAnnotationId1": { "success": true, "id": "yourAnnotationId", "message": "Deleted Successfully" }, "yourAnnotationId2": { "success": false, "id": "yourAnnotationId2", "message": "Annotation not found." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Annotations deleted successfully.", "data": { "yourAnnotationId": { "success": true, "id": "yourAnnotationId", "message": "Deleted Successfully" } } } } ``` # Get Comment Annotations POST https://api.velt.dev/v1/commentannotations/get Use this API to retrieve comment annotations from a document within an organization. Additional filters can be applied using location IDs, annotation IDs, or user IDs. # Endpoint `POST https://api.velt.dev/v1/commentannotations/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Array of Location IDs. Limit: Only 30 IDs can be passed at a time. Array of Annotation IDs. Limit: Only 30 IDs can be passed at a time. Array of User IDs. Limit: Only 30 IDs can be passed at a time. ## **Example Requests** #### 1. Get annotations by organizationId and documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", } } ``` #### 2. Get annotations by organizationId, documentId, and locationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], } } ``` #### 3. Get annotations by organizationId, documentId, locationIds, and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "userIds": [ "yourUserId" ], } } ``` #### 4. Get annotations by organizationId, documentId, and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId" ], } } ``` #### 5. Get annotations by organizationId, documentId, and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ], } } ``` #### 6. Get annotations by organizationId, documentId, locationIds, and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ], } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Annotations fetched successfully.", "data": [ { "annotationId": "yourAnnotationId", "comments": [ { "commentId": 123456, "commentText": "This is a sample comment text.", "commentHtml": "

This is a sample comment text.

", "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "lastUpdated": "2023-06-15T10:30:00Z" } ], "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "color": "#00FF00", "createdAt": "2023-06-15T10:30:00Z", "lastUpdated": "2023-06-15T10:30:00Z", "status": { "id": "OPEN", "name": "Open", "color": "#0000FF", "type": "default" } }, null // null is returned only if you provided an annotationId that doesn't exist ] } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Annotations fetched successfully.", "data": [ { "annotationId": "yourAnnotationId", "comments": [ { "commentId": 123456, "commentText": "This is a sample comment text.", "commentHtml": "

This is a sample comment text.

", "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "lastUpdated": "2023-06-15T10:30:00Z", "type": "text", } ], "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "color": "#00FF00", "createdAt": "2023-06-15T10:30:00Z", "lastUpdated": "2023-06-15T10:30:00Z", "status": { "id": "OPEN", "name": "Open", "color": "#0000FF", "type": "default" } }, null // null is returned only if you provided an annotationId that doesn't exist ] } } ```
# Get Comment Annotations v2 POST https://api.velt.dev/v2/commentannotations/get Use this API to retrieve comment annotations from a document within an organization. Additional filters can be applied using location IDs, annotation IDs, or user IDs. # Endpoint `POST https://api.velt.dev/v2/commentannotations/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Array of Location IDs. Limit: Only 30 IDs can be passed at a time. Array of Annotation IDs. Limit: Only 30 IDs can be passed at a time. Array of User IDs. Limit: Only 30 IDs can be passed at a time. Number of items to be retrieved per page. Default: 1000. Page token retrieved from previous API call. Order of results based on `lastUpdated` timestamp. Options: `asc` or `desc`. Default: `desc`. Status ID of the annotations to filter on. ## **Example Requests** #### 1. Get annotations by organizationId and documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "pageSize": 10, "pageToken": "1720441573192", "statusId": "OPEN" } } ``` #### 2. Get annotations by organizationId, documentId, and locationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "pageSize": 10, "pageToken": "1720441573192", "statusId": "OPEN" } } ``` #### 3. Get annotations by organizationId, documentId, locationIds, and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "userIds": [ "yourUserId" ], "pageSize": 10, "pageToken": "1720441573192", "statusId": "OPEN" } } ``` #### 4. Get annotations by organizationId, documentId, and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId" ], "pageSize": 10, "pageToken": "1720441573192", "statusId": "OPEN" } } ``` #### 5. Get annotations by organizationId, documentId, and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ], "pageSize": 10, "pageToken": "1720441573192", "statusId": "OPEN" } } ``` #### 6. Get annotations by organizationId, documentId, locationIds, and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ], "pageSize": 10, "pageToken": "1720441573192", "statusId": "OPEN" } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Annotations fetched successfully.", "data": [ { "annotationId": "yourAnnotationId", "comments": [ { "commentId": 123456, "commentText": "This is a sample comment text.", "commentHtml": "

This is a sample comment text.

", "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "lastUpdated": "2023-06-15T10:30:00Z" } ], "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "color": "#00FF00", "createdAt": "2023-06-15T10:30:00Z", "lastUpdated": "2023-06-15T10:30:00Z", "status": { "id": "OPEN", "name": "Open", "color": "#0000FF", "type": "default" } }, null // null is returned only if you provided an annotationId that doesn't exist ], "nextPageToken": "pageToken" } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Annotations fetched successfully.", "data": [ { "annotationId": "yourAnnotationId", "comments": [ { "commentId": 123456, "commentText": "This is a sample comment text.", "commentHtml": "

This is a sample comment text.

", "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "lastUpdated": "2023-06-15T10:30:00Z", "type": "text", } ], "from": { "userId": "user123", "name": "John Doe", "email": "john.doe@example.com" }, "color": "#00FF00", "createdAt": "2023-06-15T10:30:00Z", "lastUpdated": "2023-06-15T10:30:00Z", "status": { "id": "OPEN", "name": "Open", "color": "#0000FF", "type": "default" } }, null // null is returned only if you provided an annotationId that doesn't exist ], "nextPageToken": "pageToken" } } ```
# Update Comment Annotations POST https://api.velt.dev/v1/commentannotations/update Use this API to update comment annotations in a document within an organization. Additional filters can be applied using location IDs, annotation IDs, or user IDs. # Endpoint `POST https://api.velt.dev/v1/commentannotations/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Array of Location IDs Array of User IDs. These are the users who created the comment annotation. Array of Annotation IDs Location ID Location Name Target Element Element DOM Id Target Text. Provide this if you want to add comment annotation on the provided text content. Occurrence. Provide this if you want to add comment annotation on a text content. Select All Content. Provide this if you want to select and add comment annotation on the entire text content of the target elementId. Array of Comment Data Comment content in plain text string Comment content in HTML string User object from whom the comment is added User object from whom the Comment Annotation is added Status Type Default Ongoing Terminal Light Color Raw SVG of the icon Icon URL User object to whom the comment is assigned Custom key/value metadata object Priority Priority ID Priority Color Priority Name Priority Light Color ## **Example Requests** #### 1. Update all comment annotations by organizationId and documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "updatedData" : { "status": { "type": "ongoing" } } } } ``` #### 2. Update comment annotations by organizationId, documentId and locationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "updatedData" : { "status": { "type": "ongoing" } } } } ``` #### 3. Update annotations by organizationId, documentId, locationIds and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "userIds": [ "yourUserId" ], "updatedData" : { "status": { "type": "ongoing" } } } } ``` #### 4. Update comment annotations by organizationId, documentId and userIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId" ], "updatedData" : { "status": { "type": "ongoing" } } } } ``` #### 5. Update comment annotations by organizationId, documentId and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ], "updatedData" : { "status": { "type": "ongoing" } } } } ``` #### 6. Update comment annotations by organizationId, documentId, locationIds and annotationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationIds": [ "locationx" ], "annotationIds": [ "yourAnnotationId1", "yourAnnotationId2" ], "updatedData" : { "status": { "type": "ongoing" } } } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Annotations updated successfully.", "data": [ "yourAnnotationId1", "yourAnnotationId2", "yourAnnotationId3", "yourAnnotationId4", "yourAnnotationId5", "yourAnnotationId6", "yourAnnotationId7" ] } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Annotations updated successfully.", "data": [ "yourAnnotationId1", "yourAnnotationId2", "yourAnnotationId3", "yourAnnotationId4", "yourAnnotationId5", "yourAnnotationId6", "yourAnnotationId7" ] } } ``` # Add Comments POST https://api.velt.dev/v1/commentannotations/comments/add Use this API to add comments within a specific CommentAnnotation. # Endpoint `POST https://api.velt.dev/v1/commentannotations/comments/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Comment Annotation ID Array of Comment Data Comment content in plain text string Comment content in HTML string User object from whom the comment is added ## **Example Requests** #### 1. Add comment in a CommentAnnotation by organizationId, documentId, and annotationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationId": "yourAnnotationId", "commentData": [ { "commentText": "Sample Comment", "commentHtml": "
Hello
", "from": { "userId": "yourUserId" } } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Comment(s) added successfully.", "data": [ 778115 ] } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Comment(s) added successfully.", "data": [ 778115 ] } } ``` # Delete Comments POST https://api.velt.dev/v1/commentannotations/comments/delete Use this API to delete comments within a specific CommentAnnotation. Additional filters can be applied using comment IDs. # Endpoint `POST https://api.velt.dev/v1/commentannotations/comments/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Comment Annotation ID Array of Comment IDs ## **Example Requests** #### 1. Delete all comments of a CommentAnnotation by organizationId, documentId, and annotationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationId": "yourAnnotationId" } } ``` #### 2. Delete specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationId": "yourAnnotationId", "commentIds": [ 153783, 607395 ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Comments(s) deleted successfully.", "data": { "153783": { "success": true, "id": 153783, "message": "Deleted successfully" }, "607395": { "success": false, "id": 607395, "message": "Not found" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Comments(s) deleted successfully.", "data": { "153783": { "success": true, "id": 153783, "message": "Deleted successfully" } } } } ``` # Get Comments POST https://api.velt.dev/v1/commentannotations/comments/get Use this API to retrieve comments in a specific CommentAnnotation. Additional filters can be applied using comment IDs. # Endpoint `POST https://api.velt.dev/v1/commentannotations/comments/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Comment Annotation ID User IDs Array of Comment IDs ## **Example Requests** #### 1. Get all comments with a CommentAnnotation by organizationId, documentId, and annotationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationId": "yourAnnotationId" } } ``` #### 2. Get specific comments of a CommentAnnotation by organizationId, documentId, annotationId and commentIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationId": "yourAnnotationId", "commentIds": [ 153783, 607395 ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Comments(s) retrieved successfully.", "data": [ { "commentHtml": "
Hello Updated 2
", "commentId": 153783, "commentText": "Sample Comment Text", "from": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "lastUpdated": "2024-06-20T09:53:42.258Z", "status": "added", "type": "text" }, null // If comment not found ] } } ``` ```js { "result": { "status": "success", "message": "Comments(s) retrieved successfully.", "data": [ { "commentHtml": "
Hello Updated 2
", "commentId": 153783, "commentText": "Sample Comment Text", "from": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "lastUpdated": "2024-06-20T09:53:42.258Z", "status": "added", "type": "text" } ] } } ```
# Update Comments POST https://api.velt.dev/v1/commentannotations/comments/update Use this API to update comments within a specific CommentAnnotation. # Endpoint `POST https://api.velt.dev/v1/commentannotations/comments/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Comment Annotation ID Comment IDs Comment data Comment content in plain text string Comment content in HTML string User object from whom the comment is added ## **Example Requests** #### Update comment in a CommentAnnotation by organizationId, documentId, annotationId and commentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "annotationId": "yourAnnotationId", "commentIds": [ 153783, 607395 ], "updatedData": { "commentText": "Sample Updated Comment", "commentHtml": "
Hello Updated
" } } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Comment updated successfully.", "data": { "607395": { "success": true, "id": 607395, "message": "Updated successfully" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Comment updated successfully.", "data": { "607395": { "success": true, "id": 607395, "message": "Updated successfully" } } } } ``` # Add Documents POST https://api.velt.dev/v1/organizations/documents/add Use this API to add documents with metadata to an organization. # Endpoint `POST https://api.velt.dev/v1/organizations/documents/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Document objects ## **Example Requests** ```JSON { "data": { "organizationId": "yourOrganizationId", "documents": [ { "documentId": "yourDocumentId", "documentName": "Your Document Name" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Document(s) added successfully.", "data": { "yourDocumentId": { "success": true, "id": "8121657101517513", "message": "Added Successfully" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Document(s) added successfully.", "data": { "yourDocumentId": { "success": true, "id": "8121657101517513", "message": "Added Successfully" } } } } ``` # Delete Documents POST https://api.velt.dev/v1/organizations/documents/delete Use this API to delete specific documents from an organization. # Endpoint `POST https://api.velt.dev/v1/organizations/documents/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Document IDs ## **Example Requests** ```JSON { "data": { "organizationId": "yourOrganizationId", "documentIds": ["yourDocumentId1", "yourDocumentId2"] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Document(s) deleted successfully.", "data": { "yourDocumentId1": { "success": true, "id": "6737987049068973", "message": "Deleted Successfully" }, "yourDocumentId2": { "success": true, "id": "2131443384150904", "message": "Document does not exist" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Document(s) deleted successfully.", "data": { "yourDocumentId1": { "success": true, "id": "6737987049068973", "message": "Deleted Successfully" } } } } ``` # Get Documents POST https://api.velt.dev/v1/organizations/documents/get Use this API to retrieve specific documents or all documents from an organization. # Endpoint `POST https://api.velt.dev/v1/organizations/documents/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Document IDs. Limit: Only 30 IDs can be passed at a time. ## **Example Requests** #### 1. Get all documents from organization ```JSON { "data": { "organizationId": "yourOrganizationId", } } ``` #### 2. Get specific documents from organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentIds": ["yourDocumentId1", "yourDocumentId2"], } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Document(s) retrieved successfully.", "data": [ { "documentName": "yourDocumentName", "disabled": false, "accessType": "public", "id": "yourDocumentId", } ] } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Document(s) retrieved successfully.", "data": [ { "documentName": "yourDocumentName", "disabled": false, "accessType": "public", "id": "yourDocumentId", } ] } } ``` # Get Documents v2 POST https://api.velt.dev/v2/organizations/documents/get Use this API to retrieve specific documents or all documents from an organization. # Endpoint `POST https://api.velt.dev/v2/organizations/documents/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Document IDs. Limit: Only 30 IDs can be passed at a time. Number of items to be retrieved per page. Default: 1000. Page token retrieved from previous API call. ## **Example Requests** #### 1. Get all documents from organization ```JSON { "data": { "organizationId": "yourOrganizationId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` #### 2. Get specific documents from organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentIds": ["yourDocumentId1", "yourDocumentId2"], } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Document(s) retrieved successfully.", "data": [ { "documentName": "yourDocumentName", "disabled": false, "accessType": "public", "id": "yourDocumentId", } ], "pageToken": "nextPageToken" } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Document(s) retrieved successfully.", "data": [ { "documentName": "yourDocumentName", "disabled": false, "accessType": "public", "id": "yourDocumentId", } ], "pageToken": "nextPageToken" } } ``` # Update Access for Documents POST https://api.velt.dev/v1/organizations/documents/access/update Use this API to update the access type for a single or multiple documents at once. You can update the default access type for all the documents associated with your API Key in [console](https://console.velt.dev/dashboard/config/appconfig). # Endpoint `https://api.velt.dev/v1/organizations/documents/access/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Document IDs Access type for the documents. Allowed values: `organizationPrivate`, `restricted`, `public`. [Learn more](/key-concepts/access-control/overview). ## **Example Requests** ```JSON { "data": { "organizationId": "yourOrganizationId", "documentIds": ["yourDocumentId1, yourDocumentId2"], "accessType": "organizationPrivate" } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Updated access for documents successfully.", "data": { "yourDocumentId": { "success": true, "accessType": "organizationPrivate", "message": "Document access type updated." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Updated access for documents successfully.", "data": { "yourDocumentId": { "success": true, "accessType": "organizationPrivate", "message": "Document access type updated." } } } } ``` # Update Disabled State for Documents POST https://api.velt.dev/v1/organizations/documents/access/disablestate/update Use this API to enable or disable both read and write access for all users. Let's say your customer's trial or subscription has ended and you want to disable their access to the Velt data, you could use this to diable access to specific documents. # Endpoint `https://api.velt.dev/v1/organizations/documents/access/disablestate/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body #### Params Organization ID Array of Document IDs Whether to disable read and write access to the specified documents. Allowed values: `true`, `false` ## **Example Requests** ```JSON { "data": { "organizationId": "yourOrganizationId", "documentIds": ["yourDocumentId"], "disabled": true } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Updated disable state for documents successfully.", "data": { "yourDocumentId": { "success": true, "disabled": true, "message": "Document disabled state updated." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Updated disable state for documents successfully.", "data": { "yourDocumentId": { "success": true, "disabled": true, "message": "Document disabled state updated." } } } } ``` # Update Documents POST https://api.velt.dev/v1/organizations/documents/update Use this API to update metadata of documents within an organization. # Endpoint `POST https://api.velt.dev/v1/organizations/documents/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Document objects ## **Example Requests** ```JSON { "data": { "organizationId": "yourOrganizationId", "documents": [ { "documentId": "yourDocumentId", "documentName": "Your Document Name" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Document(s) updated successfully.", "data": { "yourDocumentId": { "success": true, "id": "8121657101517513", "message": "Updated Successfully" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Document(s) updated successfully.", "data": { "yourDocumentId": { "success": true, "id": "8121657101517513", "message": "Updated Successfully" } } } } ``` # Delete Data by Location POST https://api.velt.dev/v1/organizations/documents/locations/data/delete Delete all data associated with a specific location Use this API to delete all data (comments, recordings, or any other feature data) associated with a specific location. # Endpoint `POST https://api.velt.dev/v1/organizations/documents/locations/data/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Your API key Your Auth Token Document ID The location object containing the data to be deleted ## **Example Request** ```JSON { "data": { "apiKey": "YOUR_API_KEY", "authToken": "YOUR_AUTH_TOKEN", "documentId": "YOUR_DOCUMENT_ID", "location": { "id": "scene_1", "locationName": "White scene" } } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Data deleted successfully.", "data": null } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Data deleted successfully.", "data": null } } ``` # Update Location POST https://api.velt.dev/v1/organizations/documents/locations/update Update a Location's metadata Use this API to update a Location's metadata. # Endpoint `POST https://api.velt.dev/v1/organizations/documents/locations/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Your API key Your Auth Token Document ID The current location object The updated location object When true, merges new location fields with existing ones. When false, completely replaces the old location object. Default: false ## **Example Request** ```JSON { "data": { "apiKey": "YOUR_API_KEY", "authToken": "YOUR_AUTH_TOKEN", "documentId": "YOUR_DOCUMENT_ID", "migrate": { "oldLocation": { "id": "scene_1", "locationName": "Untitled scene" }, "newLocation": { "id": "scene_1", "locationName": "White scene" } }, "merge": true } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Location updated.", "data": null } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Location updated.", "data": null } } ``` # Add Notifications POST https://api.velt.dev/v1/notifications/add Use this API to add notifications. # Endpoint `POST https://api.velt.dev/v1/notifications/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID User who took the action Display Headline Message Template Display Headline Message Template Data (Optional) User who took the action User who was directly affected by the action Any custom field with string value Display Body Message Array of Notify Users Any custom object to be stored with the notification. When the user clicks on the notification, this data will be sent in the callback. ## **Example Request** ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "actionUser": { "userId": "yourUserId", "name": "User Name", "email": "user@example.com" }, "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}", "displayHeadlineMessageTemplateData": { "actionUser": { "userId": "yourUserId", "name": "User Name", "email": "user@example.com" }, "recipientUser": { "userId": "recipientUserId", "name": "Recipient Name", "email": "recipient@example.com" }, "yourCustomField": "Variable will be replaced with this text" }, "displayBodyMessage": "This is body message (Secondary message)", "notifyUsers": [ { "email": "test@example.com", "userId": "testingUserId" }, { "userId": "yourUserId", "name": "User Name", "email": "user@example.com" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Notification added successfully.", "data": { "success": true, "message": "Notification added successfully." } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Notification added successfully.", "data": { "success": true, "message": "Notification added successfully." } } } ``` # Delete Notifications POST https://api.velt.dev/v1/notifications/delete Use this API to delete notifications. # Endpoint `POST https://api.velt.dev/v1/notifications/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID (Optional) Location ID (Optional) User ID (Optional) Array of Notification IDs (Optional) ## **Example Requests** #### 1. Delete by organizationId and documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId" } } ``` #### 2. Delete by organizationId, documentId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 3. Delete by organizationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId" } } ``` #### 4. Delete by organizationId, userId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 5. Delete by organizationId, documentId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId" } } ``` #### 6. Delete by organizationId, documentId, userId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 7.Delete by organizationId, documentId and locationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId" } } ``` #### 8. Delete by organizationId, documentId, locationId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 9. Delete by organizationId, locationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "locationId": "yourLocationId", "userId": "yourUserId", } } ``` #### 10. Delete by organizationId, locationId, userId, and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "locationId": "yourLocationId", "userId": "yourUserId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 11. Delete by organizationId, documentId, locationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId", "userId": "yourUserId", } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Notification(s) deleted successfully.", "data": { "8955243231506071": { "success": true, "message": "Notification deleted." } } } } ``` #### When some notifications are not found ```JSON { "result": { "status": "success", "message": "Notification(s) deleted successfully.", "data": { "89552432315060712": { "success": false, "message": "Failed to delete notification." }, "8955243231506071": { "success": true, "message": "Notification deleted." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Notification(s) deleted successfully.", "data": { "8955243231506071": { "success": true, "message": "Notification deleted." } } } } ``` # Get Notifications POST https://api.velt.dev/v1/notifications/get Use this API to retrieve notifications. # Endpoint `POST https://api.velt.dev/v1/notifications/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID Location ID User ID Array of Notification IDs. Limit: Only 30 items can be passed at a time. ## **Example Requests** #### 1. Get by organizationId, documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId" } } ``` #### 2. Get by organizationId, documentId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 3. Get by organizationId, documentId and locationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId" } } ``` #### 4. Get by organizationId, documentId, locationId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 5. Get by organizationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId" } } ``` #### 6. Get by organizationId, userId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 7. Get by organizationId, documentId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId" } } ``` #### 8. Get by organizationId, locationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "locationId": "yourLocationId" } } ``` #### 9. Get by organizationId, documentId, locationId, and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId", "locationId": "yourLocationId" } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Notification(s) retrieved successfully.", "data": [ { "id": "notificationId", "notificationSource": "custom", "notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "displayBodyMessage": "This is body message (Secondary message)", "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}", "displayHeadlineMessageTemplateData": { "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "recipientUser": { "email": "recipient@example.com", "name": "Recipient Name", "userId": "recipientUserId" }, "yourCustomVariableWithStringValue": "Variable will be replaced with this text" }, "metadata": { "apiKey": "yourApiKey", "documentId": "yourDocumentId", "organizationId": "yourOrganizationId" }, "notifyUsers": { "yourNotifyUserId": true }, "notifyUsersByUserId": { "yourNotifyUserById": true }, "timestamp": 1722409519944 } ] } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Notification(s) retrieved successfully.", "data": [ { "id": "notificationId", "notificationSource": "custom", "notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "displayBodyMessage": "This is body message (Secondary message)", "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}", "displayHeadlineMessageTemplateData": { "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "recipientUser": { "email": "recipient@example.com", "name": "Recipient Name", "userId": "recipientUserId" }, "yourCustomVariableWithStringValue": "Variable will be replaced with this text" }, "metadata": { "apiKey": "yourApiKey", "documentId": "yourDocumentId", "organizationId": "yourOrganizationId" }, "notifyUsers": { "yourNotifyUserId": true }, "notifyUsersByUserId": { "yourNotifyUserById": true }, "timestamp": 1722409519944 } ] } } ``` # Get Notifications v2 POST https://api.velt.dev/v2/notifications/get Use this API to retrieve notifications. # Endpoint `POST https://api.velt.dev/v2/notifications/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID. Either pass this or userId. Location ID User ID. Either pass this or documentId. Array of Notification IDs. Limit: Only 30 items can be passed at a time. Number of items to be retrieved per page. Default: 1000. Page token retrieved from previous API call. Order of the notifications based on timestamp. Default: desc. ## **Example Requests** #### 1. Get by organizationId, documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` #### 2. Get by organizationId, documentId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 3. Get by organizationId, documentId and locationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` #### 4. Get by organizationId, documentId, locationId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 5. Get by organizationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` #### 6. Get by organizationId, userId and notificationIds ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "notificationIds": [ "yourNotificationId" ] } } ``` #### 7. Get by organizationId, documentId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` #### 8. Get by organizationId, locationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "locationId": "yourLocationId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` #### 9. Get by organizationId, documentId, locationId, and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId", "locationId": "yourLocationId", "pageSize": 20, "pageToken": "8740648311207869" } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Notification(s) retrieved successfully.", "data": [ { "id": "notificationId", "notificationSource": "custom", "notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "displayBodyMessage": "This is body message (Secondary message)", "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}", "displayHeadlineMessageTemplateData": { "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "recipientUser": { "email": "recipient@example.com", "name": "Recipient Name", "userId": "recipientUserId" }, "yourCustomVariableWithStringValue": "Variable will be replaced with this text" }, "metadata": { "apiKey": "yourApiKey", "documentId": "yourDocumentId", "organizationId": "yourOrganizationId" }, "notifyUsers": { "yourNotifyUserId": true }, "notifyUsersByUserId": { "yourNotifyUserById": true }, "timestamp": 1722409519944 } ], "pageToken": "nextPageToken" } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Notification(s) retrieved successfully.", "data": [ { "id": "notificationId", "notificationSource": "custom", "notificationSourceData": {}, //The data of the notification source. e.g., CommentAnnotation "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "displayBodyMessage": "This is body message (Secondary message)", "displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}", "displayHeadlineMessageTemplateData": { "actionUser": { "email": "user@example.com", "name": "User Name", "userId": "yourUserId" }, "recipientUser": { "email": "recipient@example.com", "name": "Recipient Name", "userId": "recipientUserId" }, "yourCustomVariableWithStringValue": "Variable will be replaced with this text" }, "metadata": { "apiKey": "yourApiKey", "documentId": "yourDocumentId", "organizationId": "yourOrganizationId" }, "notifyUsers": { "yourNotifyUserId": true }, "notifyUsersByUserId": { "yourNotifyUserById": true }, "timestamp": 1722409519944 } ], "pageToken": "nextPageToken" } } ``` # Update Notifications POST https://api.velt.dev/v1/notifications/update Use this API to update notifications. # Endpoint `POST https://api.velt.dev/v1/notifications/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document ID (Optional) Location ID User ID (Optional) Notifications object Notification ID User who took the action Display Headline Message Template Display Headline Message Template Data User who took the action User who was directly affected by the action Any custom field with string value Display Body Message Any custom object to be stored with the notification. When the user clicks on the notification, this data will be sent to in the callback. ## **Example Requests** #### 1. Update by organizationId and documentId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "notifications": [ { "id": "yourNotificationId", "displayBodyMessage": "This is body message (Secondary message)", } ] } } ``` #### 2. Update by organizationId, documentId and locationId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "locationId": "yourLocationId", "notifications": [ { "id": "yourNotificationId", "displayBodyMessage": "This is body message (Secondary message)", } ] } } ``` #### 3. Update by organizationId, documentId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId", "notifications": [ { "id": "yourNotificationId", "displayBodyMessage": "This is body message (Secondary message)", } ] } } ``` #### 4. Update by organizationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "userId": "yourUserId", "notifications": [ { "id": "yourNotificationId", "displayBodyMessage": "This is body message (Secondary message)", } ] } } ``` #### 5. Update by organizationId, documentId, locationId and userId ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userId": "yourUserId", "locationId": "yourLocationId", "notifications": [ { "id": "yourNotificationId", "displayBodyMessage": "This is body message (Secondary message)", } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Notification(s) updated successfully.", "data": { "5471488637912692": { "success": true, "message": "Notification updated." } } } } ``` #### When some notifications are not found ```JSON { "result": { "status": "success", "message": "Notification(s) updated successfully.", "data": { "5471488637912692": { "success": false, "message": "Failed to update notification." }, "5471488637912693": { "success": true, "message": "Notification updated." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Notification(s) updated successfully.", "data": { "5471488637912692": { "success": true, "message": "Notification updated." } } } } ``` # Add User Groups POST https://api.velt.dev/v1/organizations/usergroups/add Use this API to add organization user groups to a specific organization. # Endpoint `POST https://api.velt.dev/v1/organizations/usergroups/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Array of Organization User Group objects ## **Example Request** #### Add organization user group in a specific organization ```JSON { "data": { "organizationId": "yourOrganizationId", "organizationUserGroups": [ { "groupId": "engineering", "groupName": "Engineering" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Organization User Groups added successfully.", "data": { "yourGroupId": { "success": true, "id": "77ab6767b022ad0323ba39c24f12cc95", "message": "Organization user group added." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Organization User Groups added successfully.", "data": { "yourGroupId": { "success": true, "id": "77ab6767b022ad0323ba39c24f12cc95", "message": "Organization user group added." } } } } ``` # Add Users to Groups POST https://api.velt.dev/v1/organizations/usergroups/users/add Use this API to add users to a specific organization user group. # Endpoint `POST https://api.velt.dev/v1/organizations/usergroups/users/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Organization User Group ID Array of User IDs ## **Example Requests** ```JSON { "data": { "organizationId": "yourOrganizationId", "organizationUserGroupId": "yourGroupId", "userIds": ["yourUserId1"] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Added organization users to group successfully.", "data": { "yourUserId1": { "success": true, "organizationUserGroupId": "yourGroupId", "message": "User added to organization user group." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Added organization users to group successfully.", "data": { "yourUserId1": { "success": true, "organizationUserGroupId": "yourGroupId", "message": "User added to organization user group." } } } } ``` # Delete Users from Groups POST https://api.velt.dev/v1/organizations/usergroups/users/delete Use this API to delete users from a specific organization user group. # Endpoint `POST https://api.velt.dev/v1/organizations/usergroups/users/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Organization User Group ID Array of User IDs ## **Example Requests** #### Delete specific users from group ```JSON { "data": { "organizationId": "yourOrganizationId", "organizationUserGroupId": "yourGroupId", "userIds": ["yourUserId1"] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Deleted users from group successfully.", "data": { "yourUserId1": { "success": true, "organizationUserGroupId": "yourGroupId", "message": "User deleted from organization user group." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Deleted users from group successfully.", "data": { "yourUserId1": { "success": true, "organizationUserGroupId": "yourGroupId", "message": "User deleted from organization user group." } } } } ``` # Add Organizations POST https://api.velt.dev/v1/organizations/add Use this API to add new organizations and its metadata. # Endpoint `POST https://api.velt.dev/v1/organizations/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of Organization objects ## **Example Requests** #### Add organization ```JSON { "data": { "organizations": [ { "organizationId": "yourOrganizationId", "organizationName": "Your Organization Name" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Organization(s) added successfully.", "data": { "yourOrganizationId": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Added Successfully" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Organization(s) added successfully.", "data": { "yourOrganizationId": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Added Successfully" } } } } ``` # Delete Organizations POST https://api.velt.dev/v1/organizations/delete Use this API to delete specific organization(s) data by their IDs. # Endpoint `POST https://api.velt.dev/v1/organizations/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of Organization IDs ## **Example Requests** #### Delete specific organization ```JSON { "data": { "organizationIds": [ "yourOrganizationId1", "yourOrganizationId2" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Organization(s) deleted successfully.", "data": { "yourOrganizationId1": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Deleted Successfully" }, { "yourOrganizationId2": { "success": false, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Organization does not exist" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Organization(s) deleted successfully.", "data": { "yourOrganizationId": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Deleted Successfully" } } } } ``` # Get Organizations POST https://api.velt.dev/v1/organizations/get Use this API to retrieve specific organizations by organization IDs. # Endpoint `POST https://api.velt.dev/v1/organizations/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of Organization IDs (Optional). Limit: Only 30 IDs can be passed at a time. If this is not provided, all organizations will be returned. ## **Example Requests** ```JSON { "data": { "organizationIds": [ "yourOrganizationId" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Organization(s) retrieved successfully.", "data": [ { "id": "yourOrganizationId", "organizationName": "Your Organization Name", "disabled": false, // other metadata fields may be included here } // ... more organizations if multiple were retrieved ] } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Organization(s) retrieved successfully.", "data": [ { "id": "yourOrganizationId", "organizationName": "Your Organization Name", "disabled": false, // other metadata fields may be included here } // ... more organizations if multiple were retrieved ] } } ``` # Get Organizations v2 POST https://api.velt.dev/v2/organizations/get Use this API to retrieve specific organizations by organization IDs. # Endpoint `POST https://api.velt.dev/v2/organizations/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of Organization IDs (Optional). Limit: Only 30 IDs can be passed at a time. If this is not provided, all organizations will be returned. Number of items to be retrieved per page (Optional). Default: 1000. Page token retrieved from previous API call. (Optional) ## **Example Requests** ```JSON { "data": { "organizationIds": [ "yourOrganizationId" ], "pageSize": 1000, "pageToken": "pageToken" } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Organization(s) retrieved successfully.", "data": [ { "id": "yourOrganizationId", "organizationName": "Your Organization Name", "disabled": false, // other metadata fields may be included here } // ... more organizations if multiple were retrieved ], "nextPageToken": "pageToken" } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Organization(s) retrieved successfully.", "data": [ { "id": "yourOrganizationId", "organizationName": "Your Organization Name", "disabled": false, // other metadata fields may be included here } // ... more organizations if multiple were retrieved ], "nextPageToken": "pageToken" } } ``` # Update Disabled State for Organizations POST https://api.velt.dev/v1/organizations/access/disablestate/update Use this API to enable or disable both read and write access for all documents for all users. Let's say your customer's trial or subscription has ended and you want to disable their access to the Velt data, you could use this to disable access to the entire organization data. If organization does not exist, it will be created. # Endpoint `POST https://api.velt.dev/v1/organizations/access/disablestate/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of Organization IDs Whether to disable read and write access to the specified organizations. Allowed values: `true`, `false`. ## **Example Requests** ```JSON { "data": { "organizationIds": ["yourOrganizationId1","yourOrganizationId2"], "disabled": true } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Updated disable state for Organization(s) successfully.", "data": { "yourOrganizationId1": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Updated disable state for organization Successfully" }, "yourOrganizationId2": { "success": false, "id": "44e0132f4c6b0d453f18df42d2263b4e", "message": "Organization does not exist" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Updated disable state for Organization(s) successfully.", "data": { "yourOrganizationId": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Updated disable state for organization Successfully" } } } } ``` # Update Organizations POST https://api.velt.dev/v1/organizations/update Use this API to update existing organization(s) metadata. # Endpoint `POST https://api.velt.dev/v1/organizations/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of Organization objects ## **Example Requests** ```JSON { "data": { "organizations": [ { "organizationId": "yourOrganizationId", "organizationName": "Your Updated Organization Name" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "Organization(s) updated successfully.", "data": { "yourOrganizationId": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Updated Successfully" } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Organization(s) updated successfully.", "data": { "yourOrganizationId": { "success": true, "id": "02cf91e5e7a5f4c0b600c84cf248384b", "message": "Updated Successfully" } } } } ``` # Add Users POST https://api.velt.dev/v1/users/add Use this API to add Users to: 1. **Organization:** This will provide them access to all the documents in the organization. It will also show users in the contact list of the organization. 2. **Document:** This will provide them access to the specified document. It will also show users in the contact list of the document. If you pass the `documentId`, then the users will be added to the document. If organization does not exist, it will be created. If User's `initial` is not provided in the User object, then it will be automatically created using the name field. # Endpoint `POST https://api.velt.dev/v1/users/add` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document IDs. Provide this if you want to add users to a specific document. Array of [User](/api-reference/models/User) objects. ## **Example Requests** #### 1. Add users to a specific organization ```JSON { "data": { "organizationId": "yourOrganizationId", "users": [ { "userId": "yourUserId1", "name": "User Name", "email": "user@email.com" } ] } } ``` #### 2. Add users to a specific document within an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "users": [ { "userId": "yourUserId1", "name": "User Name", "email": "user@email.com" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "User(s) processed successfully.", "data": { "yourUserId1": { "success": true, "id": "4c250058149d6c9fb8c894c9ef29c790", "message": "User added." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "User(s) processed successfully.", "data": { "yourUserId1": { "success": true, "id": "4c250058149d6c9fb8c894c9ef29c790", "message": "User added." } } } } ``` # Delete All User Data (GDPR) POST https://api.velt.dev/v1/users/data/delete Remove All User data from Velt. Use this API to remove all user data from Velt. This will: * remove their access from all the documents and data in the organization. * remove them from @mention contact dropdown list. * remove them from @mentions where they were tagged. * remove all feature data created by the user. eg: comments, reactions, notifications etc. # Endpoint `POST https://api.velt.dev/v1/users/data/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Array of user Ids. ## **Example Request** ```JSON { "data": { "userIds": [ "yourUserId1", "yourUserId2" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "User(s) deleted successfully.", "data": { "yourUserId1": { "success": true, "message": "User removed." } } } } ``` #### User(s) Not Found ```JSON { "result": { "status": "success", "message": "Deleted user data successfully.", } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "Deleted user data successfully.", } } ``` # Delete Users POST https://api.velt.dev/v1/users/delete Remove Users from an Organization or a Document. Use this API to remove Users from: 1. **Organization:** This will remove their access from all the documents and data in the organization. It will also remove these users from the contact list of the organization. 2. **Document:** This will remove their access from the specified document. It will also remove these users from the contact list of the document. If you pass the `documentId`, then the users will be removed from the document. # Endpoint `POST https://api.velt.dev/v1/users/delete` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### Params Organization ID Document IDs. Provide this if you want to delete users from a specific document. Array of user Ids. ## **Example Requests** #### 1. Delete users in a specific organization ```JSON { "data": { "organizationId": "yourOrganizationId", "userIds": [ "yourUserId1" ] } } ``` #### 2. Delete users in a specific document within an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId1" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "User(s) deleted successfully.", "data": { "yourUserId1": { "success": true, "message": "User removed." } } } } ``` #### User(s) Not Found ```JSON { "result": { "status": "success", "message": "User(s) deleted successfully.", "data": { "yourUserId1": { "success": true, "message": "User removed." }, { "yourUserId2": { "success": false, "message": "User does not exist." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "User(s) deleted successfully.", "data": { "yourUserId1": { "success": true, "message": "User removed." } } } } ``` # Get Users POST https://api.velt.dev/v1/users/get Use this API to retrieve users based on various filters such as organization ID, document ID, organization user group IDs or user IDs. You can use these filters in various combinations to get the desired users. Some examples are shown below. # Endpoint `POST https://api.velt.dev/v1/users/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### **Params** Organization ID Document ID Array of User IDs. Limit: Only 30 items can be passed at a time. Array of Organization User Group IDs. Only 30 items can be passed at a time. ## **Example Requests** #### 1. Get users by organizationId ```JSON { "data": { "organizationId": "yourOrganizationId" } } ``` #### 2. Get users by documentId within an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId" } } ``` #### 3. Get users by specific user IDs in an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "userIds": [ "yourUserId1", "yourUserId2" ] } } ``` #### 4. Get users by specific user IDs in the given organization and document ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId1", "yourUserId2" ] } } ``` #### 5. Get users by organization and organization user group IDs ```JSON { "data": { "organizationId": "yourOrganizationId", "organizationUserGroupIds": [ "yourOrganizationUserGroupId" ] } } ``` #### 6. Get users by organization, organization user group IDs and user IDs ```JSON { "data": { "organizationId": "yourOrganizationId", "userIds": [ "yourUserId1", "yourUserId2" ], "organizationUserGroupIds": [ "yourOrganizationUserGroupId" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "User(s) retrieved successfully.", "data": [ { "email": "userEmail@domain.com", "name": "userName", "userId": "yourUserId" } ] } } ``` #### Failure Response ```JSON { "error": { "message": "Error retrieving user(s).", "status": "ERROR_CODE" } } ``` ```js { "result": { "status": "success", "message": "User(s) retrieved successfully.", "data": [ { "email": "userEmail@domain.com", "name": "userName", "userId": "yourUserId" } ] } } ``` # Get Users v2 POST https://api.velt.dev/v2/users/get Use this API to retrieve users based on various filters such as organization ID, document ID, organization user group IDs or user IDs. You can use these filters in various combinations to get the desired users. Some examples are shown below. # Endpoint `POST https://api.velt.dev/v2/users/get` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### **Params** Organization ID Document ID Array of User IDs. Limit: Only 30 items can be passed at a time. Array of Organization User Group IDs. Only 30 items can be passed at a time. Number of items to be retrieved per page. Default: 1000. Page token retrieved from previous API call. ## **Example Requests** #### 1. Get users by organizationId ```JSON { "data": { "organizationId": "yourOrganizationId", "pageSize": 1000, "pageToken": "pageToken" } } ``` #### 2. Get users by documentId within an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId" } } ``` #### 3. Get users by specific user IDs in an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "userIds": [ "yourUserId1", "yourUserId2" ] } } ``` #### 4. Get users by specific user IDs in the given organization and document ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "userIds": [ "yourUserId1", "yourUserId2" ] } } ``` #### 5. Get users by organization and organization user group IDs ```JSON { "data": { "organizationId": "yourOrganizationId", "organizationUserGroupIds": [ "yourOrganizationUserGroupId" ] } } ``` #### 6. Get users by organization, organization user group IDs and user IDs ```JSON { "data": { "organizationId": "yourOrganizationId", "userIds": [ "yourUserId1", "yourUserId2" ], "organizationUserGroupIds": [ "yourOrganizationUserGroupId" ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "User(s) retrieved successfully.", "data": [ { "email": "userEmail@domain.com", "name": "userName", "userId": "yourUserId" } ], "pageToken": "pageToken" } } ``` #### Failure Response ```JSON { "error": { "message": "Error retrieving user(s).", "status": "ERROR_CODE" } } ``` ```js { "result": { "status": "success", "message": "User(s) retrieved successfully.", "data": [ { "email": "userEmail@domain.com", "name": "userName", "userId": "yourUserId" } ], "pageToken": "pageToken" } } ``` # Update Users POST https://api.velt.dev/v1/users/update Use this API to update user metadata based on various filters such as organization ID, document ID, and user IDs. You can use these filters in various combinations to get the desired results. The user metadata such as name, email etc can be updated. # Endpoint `POST https://api.velt.dev/v1/users/update` # Headers Your API key. Your [Auth Token](/security/auth-tokens). # Body Example #### **Params** Organization ID Document ID (Optional) Array of [User](/api-reference/models/User) objects. ## **Example Requests** #### 1. Update users in a specific organization ```JSON { "data": { "organizationId": "yourOrganizationId", "users": [ { "userId": "yourUserId1", "name": "User Name", "email": "user@email.com" } ] } } ``` #### 2. Update users in a specific document within an organization ```JSON { "data": { "organizationId": "yourOrganizationId", "documentId": "yourDocumentId", "users": [ { "userId": "yourUserId1", "name": "User Name", "email": "user@email.com" } ] } } ``` # Response #### Success Response ```JSON { "result": { "status": "success", "message": "User(s) processed successfully.", "data": { "yourUserId1": { "success": true, "id": "7d87015b055a168b098cf05b870e40ff", "message": "User updated." } } } } ``` #### Some User(s) Not Found ```JSON { "result": { "status": "success", "message": "User(s) processed successfully.", "data": { "yourUserId1": { "success": true, "id": "7d87015b055a168b098cf05b870e40ff", "message": "User updated." }, "yourUserId2": { "success": false, "id": "ad22d93b49ad990d2b3d582d08d7768a", "message": "User does not exist." } } } } ``` #### Failure Response ```JSON { "error": { "message": "ERROR_MESSAGE", "status": "INVALID_ARGUMENT" } } ``` ```js { "result": { "status": "success", "message": "User(s) processed successfully.", "data": { "yourUserId1": { "success": true, "id": "7d87015b055a168b098cf05b870e40ff", "message": "User updated." } } } } ``` # Customize Behavior ## 1. Getting the Arrow Element To get access to the Arrow Element APIs, you will first need to get the Arrow Element object from the client. ```jsx const arrowElement = client.getArrowElement(); ``` ```jsx const arrowElement = Velt.getArrowElement(); ``` ## 2. Set which elements Arrows can be added to You can use the `allowedElementIds()` property to set an allowed list of elements the `Arrows` feature can be added to. ```jsx ``` ```jsx ``` API Methods: You can use the `arrowElement.allowedElementIds()` method to set an allowed list of elements the `Arrows` feature can be added to. ```jsx arrowElement.allowedElementIds(['ALLOWED_ID_1', 'ALLOWED_ID_2']); ``` ```jsx arrowElement.allowedElementIds(['ALLOWED_ID_1', 'ALLOWED_ID_2']); ``` ## 3. Dark Mode Whether dark mode is enabled. `Default: false` ```js ``` ```js ``` # Custom Button ## Custom Arrow Button If you want to replace the default arrow button with your own custom button, you can pass it in as a child component. ```js React / Next.js import { VeltArrowTool } from '@veltdev/react'; function YourComponent() { return ( //custom arrow button goes here ) } ``` ```html HTML ``` # null We offer several parts which can be used like classes. Full list below. The component is encapsulated in Shadow DOM, which is isolated from the normal DOM. Set whatever CSS rules you want. The part lets you target a specific element within a Shadow DOM. Reference the table below to see what parts we expose. Alternatively, you can directly inspect the component HTML to see what parts are available. | property | description | | ------------------ | ----------------------------------------- | | `container` | Targets the comment tool container | | `button-container` | Targets the comment tool button container | | `button-icon` | Targets the comment tool button SVG icon | ```css Tool velt-arrow-tool::part(button-icon) { width: 1.5rem; height: 1.5rem; } ``` # Slots Provide a template for the Arrow Tool. Target the `button` slot with your own custom template. ```js React / Next.js import { VeltArrowTool } from '@veltdev/react'; export default function App() { return ( <> ); } ``` ```html HTML Arrow documentation ``` # null To update CSS variables for the Arrow Tool, please refer to [Global Styles](/global-styles/global-styles) # Arrows ``` ## 9. Enable Hotkeys Whether Hotkeys are enabled or not. For now, the only hotkey supported is pressing `c` to enable `comment mode`. `Default: false` To enable hotkeys, set the `hotkey` attribute to `true`. ```html ``` ```html ``` API Methods: ```jsx const commentElement = client.getCommentElement(); // to enable hotkeys commentElement.enableHotkey(); // to disable hotkeys commentElement.disableHotkey(); ``` ```jsx const commentElement = Velt.getCommentElement(); // to enable hotkeys commentElement.enableHotkey(); // to disable hotkeys commentElement.disableHotkey(); ``` ## 10. Add Comment support on PDF Viewers ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/pdf-comments.png) To support comments on top of a pdf viewer, add the `data-velt-pdf-viewer="true"` attribute in the container element of the pdf viewer. ```jsx
``` ## 11. Filter out Comments at specific Locations Use this to filter out Comments at a specific Location for certain Users. ```jsx const locationIds = ['location1', 'location2']; // list of location ids client.excludeLocationIds(locationIds); ``` To reset it, you can pass an empty array: ```jsx client.excludeLocationIds([]); ``` ## 12. Enable Comment DOM Change Detection By default, we skip `Comment` `DOM Change Detection` when users are in `Comment Mode` to improve performance. `Default: false` However, you can turn `Comment` `DOM Change Detection` back on with the `changeDetectionInCommentMode` property. This will make `Comment's` reposition themselves if the DOM happens to change while in `Comment Mode`. ```jsx ``` However, you can turn `Comment` `DOM Change Detection` back on with the `change-detection-in-comment-mode` property. This will make `Comment's` reposition themselves if the DOM happens to change while in `Comment Mode`. ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); // To enable change detection when comment mode is on commentElement.enableChangeDetectionInCommentMode(); // To disable change detection when comment mode is on commentElement.disableChangeDetectionInCommentMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); // To enable change detection when comment mode is on commentElement.enableChangeDetectionInCommentMode(); // To disable change detection when comment mode is on commentElement.disableChangeDetectionInCommentMode(); ``` ## 13. Submit Comment on Enter Key Press By default, pressing `enter` will add a new line and pressing `shift` + `enter` will submit a comment. If you want to change this default behavior so that pressing `enter` will submit a comment, you can set the `enterKeyToSubmit` property to `true`. ```jsx ``` ```jsx // API methods const commentElement = client.getCommentElement(); // To enable enter key to submit a comment commentElement.enableEnterKeyToSubmit(); // To disable enter key to submit a comment commentElement.disableEnterKeyToSubmit(); ``` ```jsx ``` ```jsx // API methods const commentElement = Velt.getCommentElement(); // To enable enter key to submit a comment commentElement.enableEnterKeyToSubmit(); // To disable enter key to submit a comment commentElement.disableEnterKeyToSubmit(); ``` ## 14. Enable/Disable Area Comments Area comments allows users to draw a rectangle and attach a comment to it. Use this to enable or disable area comments. `Default: true` ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/enable-disable-area-comments.png) Using Props: ```jsx ``` Using API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableAreaComment(); commentElement.disableAreaComment(); ``` Using Props: ```jsx ``` Using API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableAreaComment(); commentElement.disableAreaComment(); ``` ## 15. Enable/Disable Private Comment Mode * Private comment mode enables admin users to add comments that are only visible to other admin users. * Use this to enable or disable private comment mode. `Default: false` Using Props: ```jsx ``` Using API: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePrivateComments(); commentElement.disablePrivateComments(); ``` Using Props: ```jsx ``` Using API: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePrivateCommentMode(); commentElement.disablePrivateCommentMode(); ``` ## 16. Enable/Disable deleting comments when backpsace key is pressed * Use this to enable or disable deleting comments when backpsace key is pressed. `Default: enabled` Using API: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDeleteOnBackspace(); commentElement.disableDeleteOnBackspace(); ``` Using API: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDeleteOnBackspace(); commentElement.disableDeleteOnBackspace(); ``` ## 17. Enable Delete Reply Confirmation You can enable a confirmation dialog before deleting a reply in comment threads. This feature helps prevent accidental deletions and improves user experience. Using Props: ```jsx ``` Using API: ```javascript const commentElement = client.getCommentElement(); commentElement.enableDeleteReplyConfirmation(); commentElement.disableDeleteReplyConfirmation(); ``` Using Props: ```html ``` Using API: ```javascript const commentElement = Velt.getCommentElement(); commentElement.enableDeleteReplyConfirmation(); commentElement.disableDeleteReplyConfirmation(); ``` ## 18. Source ID for Duplicate Elements * When you have multiple elements with the same DOM ID, you can use the `sourceId` attribute to control which element displays the comment dialog when adding a new comment. * By default, comments appear on all matching elements. * This is useful in cases where you have multiple instances of the same data component on a page and want the comment to appear on each instance, such as Popover comments on a table. * You can randomly generate the `sourceId`. It just needs to be unique for each element in the current session. ```jsx ``` ```html ``` ## 19. Sort Inline Comments * Change the default sorting order of Comments in the Inline Comments Section. * Default: `none` There are three options for sorting: * `asc`: Show comment annotations in ascending order of when they were last updated * `desc`: Show comment annotations in descending order of when they were last updated * `none`: Show comment annotations in the sequence they were added ```jsx ``` ```html ``` ## 20. Comment Player Timeline Offset * Allows comment bubbles to be positioned relative to both parent and child video clips by specifying an offset value. * Default: `0` ```jsx ``` ```html ``` # Modes ## 1. Freestyle mode For a complete setup guide for Freestyle mode, [read here](/async-collaboration/comments/setup/freestyle). Whether Freestyle Mode is enabled. `Default: true` ```jsx {/* Freestyle mode is enabled by default when you use VeltComments} ``` ```jsx ``` ## 2. Inbox mode For a complete setup guide for Inbox mode, [read here](/async-collaboration/comments/setup/inbox). Whether Inbox Mode is enabled. `Default: false` ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableInboxMode(); commentElement.disableInboxMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableInboxMode(); commentElement.disableInboxMode(); ``` ## 3. Popover mode For a complete setup guide for Popover mode, [read here](/async-collaboration/comments/setup/popover). Whether Popover Mode is enabled. `Default: false` ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePopoverMode(); commentElement.disablePopoverMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enablePopoverMode(); commentElement.disablePopoverMode(); ``` ## 4. Stream mode For a complete setup guide for Stream mode, [read here](/async-collaboration/comments/setup/stream). Whether Stream Mode is enabled. `Default: false` ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableStreamMode(); commentElement.disableStreamMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableStreamMode(); commentElement.disableStreamMode(); ``` ## 5. Text mode For a complete setup guide for Text mode, [read here](/async-collaboration/comments/setup/text). ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/text-comment.png) Whether Text Mode is enabled. `Default: true` ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableTextComments(); commentElement.disableTextComments(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableTextComments(); commentElement.disableTextComments(); ``` ## 6. Persistent comment mode Whether Persistent comment mode is enabled. `Default: false` When Persistent comment mode is enabled, you can continue leave additional comments after finishing a comment. When it is disabled, you will need to reclick the Comment Tool every time when you want to make a comment. ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePersistentCommentMode(); commentElement.disablePersistentCommentMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enablePersistentCommentMode(); commentElement.disablePersistentCommentMode(); ``` ## 7. Inline Comment Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/text-comment-opened.png) Whether In-line comment mode is enabled. When In-line comment mode is enabled, comments will appear under the text they are associated with in the DOM, instead of as a pop up window. `Default: false` ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableInlineCommentMode(); commentElement.disableInlineCommentMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableInlineCommentMode(); commentElement.disableInlineCommentMode(); ``` ## 8. Multithread for Comments * By default comments are single threaded. * You can make it multithreaded by setting `multiThread` prop to `true`. * If you had previously used a wireframe for the comment dialog, you will need to add the [multithread wireframe](/async-collaboration/comments/customize-ui/multithread-comment-dialog/overview). * Default: `false` ```jsx ``` ```html ``` ## 9. Multithread for Inline Comments Section * By default [inline comment section](/async-collaboration/comments/setup/inline-comments) is multithreaded. * You can make it single threaded by setting `multiThread` prop to `false`. * Default: `true` ```jsx ``` ```html ``` # Multimedia Features ## 1. File attachments ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/file-attachment.png) Whether file attachments are enabled. `Default: true` When this is on, users can attach image files to their comments. Users can download or delete an attachment. Users can attach multiple files at once. Currently we support `.png`, `.jpg`, `.gif` (static & animated), `.svg` file types up to 15MB per file. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableAttachments(); commentElement.disableAttachments(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableAttachments(); commentElement.disableAttachments(); ``` ## 2. Set Recorder Media Options ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/recorder.png) Set the Recorder media options within Comments: (audio, screen, video, all, or none). `Default: "audio"` To set the Recorder media options, pass in a comma separated string of the features you want to enable. To enable only the **screen** option: ```jsx ``` ```jsx ``` To enable the **video** and **screen** options: ```jsx ``` ```jsx ``` To enable all options: ```jsx ``` ```jsx ``` To disable all options: ```jsx ``` ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); commentElement.setAllowedRecordings("video"); // set video mode only commentElement.setAllowedRecordings("audio,screen"); // set audio and screen mode only commentElement.setAllowedRecordings("all"); // set all modes commentElement.setAllowedRecordings("none"); // disable all modes ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.setAllowedRecordings("video"); // set video mode only commentElement.setAllowedRecordings("audio,screen"); // set audio and screen mode only commentElement.setAllowedRecordings("all"); // set all modes commentElement.setAllowedRecordings("none"); // disable all modes ``` ## 3. Enable Reactions ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/reactions.png) Whether emoji reactions are enabled. `Default: true` ```jsx ``` ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); commentElement.enableReactions(); commentElement.disableReactions(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableReactions(); commentElement.disableReactions(); ``` ## 4. Disable Recording summaries ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/transcript-comment.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/transcript-summary.png) Whether `Recording` summaries in `Comments` are enabled. `Default: true` ```jsx ``` ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); // to show recording summary commentElement.enableRecordingSummary(); // to hide recording summary commentElement.disableRecordingSummary(); ``` ```jsx const commentElement = Velt.getCommentElement(); // to show recording summary commentElement.enableRecordingSummary(); // to hide recording summary commentElement.disableRecordingSummary(); ``` ## 5. Disable Recording countdown ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/recording-countdown.gif) Whether the Recorder countdown is enabled. `Default: true` ```jsx ``` ```jsx ``` API Methods: ```jsx // API method - comment element const commentElement = client.getCommentElement(); // To enable recording countdown commentElement.enableRecordingCountdown(); // To disable recording countdown commentElement.disableRecordingCountdown(); // API method - recorder element const recorderElement = client.getRecorderElement(); // To enable recording countdown recorderElement.enableRecordingCountdown(); // To disable recording countdown recorderElement.disableRecordingCountdown(); ``` ```jsx // API method - comment element const commentElement = Velt.getCommentElement(); // To enable recording countdown commentElement.enableRecordingCountdown(); // To disable recording countdown commentElement.disableRecordingCountdown(); // API method - recorder element const recorderElement = Velt.getRecorderElement(); // To enable recording countdown recorderElement.enableRecordingCountdown(); // To disable recording countdown recorderElement.disableRecordingCountdown(); ``` ## 6. Custom Reactions You can set custom reactions by passing a map that contains information about the reactions you want to add. The map keys should be the reaction ID, and the map value should contain an object with either an `url`, `svg`, or `emoji` field to represent the reaction icon you want to use. ```jsx const customReactions = { "URL_EMOJI_ID": { "url": "EMOJI_URL" }, "SVG_EMOJI_ID": { "svg": "EMOJI_SVG" }, "TEXT_EMOJI_ID": { "emoji": "🤣" // emoji as a text } }; ``` ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); const customReactions = { "URL_EMOJI_ID": { "url": "EMOJI_URL" }, "SVG_EMOJI_ID": { "svg": "EMOJI_SVG" }, "TEXT_EMOJI_ID": { "emoji": "🤣" // emoji as a text } } commentElement.setCustomReactions(customReactions); ``` ```jsx const commentElement = Velt.getCommentElement(); const customReactions = { "URL_EMOJI_ID": { "url": "EMOJI_URL" }, "SVG_EMOJI_ID": { "svg": "EMOJI_SVG" }, "TEXT_EMOJI_ID": { "emoji": "🤣" // emoji as a text } } commentElement.setCustomReactions(customReactions); ``` ## 7. enableRecordingTranscription Controls whether to enable AI transcription for recordings. Default: `enabled` **Using Props:** ```jsx ``` **Using API Methods:** ```javascript // Using comment element const commentElement = client.getCommentElement(); commentElement.enableRecordingTranscription(); commentElement.disableRecordingTranscription(); // Or using recorder element const recorderElement = client.getRecorderElement(); recorderElement.enableRecordingTranscription(); recorderElement.disableRecordingTranscription(); ``` **Using Props:** ```html ``` **Using API Methods:** ```javascript // Using comment element const commentElement = Velt.getCommentElement(); commentElement.enableRecordingTranscription(); commentElement.disableRecordingTranscription(); // Or using recorder element const recorderElement = Velt.getRecorderElement(); recorderElement.enableRecordingTranscription(); recorderElement.disableRecordingTranscription(); ``` # Retrieve Comments ## 1. To retrieve comments in the frontend To retreive all comments in the frontend, use the `useCommentAnnotations()` hook. The hook will return an array that contains all current comments. Whenever there is a change to the comments structure, the hook return value will be updated to the latest change. The hook will automatically unsubscribe from the subscription when the component dismounts. ```jsx import { useCommentAnnotations } from '@veltdev/react'; export default function YourDocument() { let commentAnnotations = useCommentAnnotations() return (
{commentAnnotations.map(x =>
{x.annotationId}
)}
) } ``` By default, `useCommentAnnotations()` will return data for the current `documentId` and `location`. If you pass in a `documentId` as an argument, it will return all comments in the given `documentId`. If you pass in a `documentId` as the first argument and a `location` object as the second argument, it will return all comments in the given `documentId` and `location`. ```jsx import { useCommentAnnotations } from '@veltdev/react'; export default function YourDocument() { let commentAnnotations = useCommentAnnotations('my-document-id', { id:'my-location-id',locationName:"MyLocationName"}) return (
{commentAnnotations.map(x =>
{x.annotationId}
)}
) } ```
To retrieve all comments in the frontend, use the `commentElement.getAllCommentAnnotations()` method and subscribe with a callback function. Whenever there is a change to the comments structure, the callback function will be triggered and will contain all current comments in an array. ```js if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getAllCommentAnnotations().subscribe((comments) => { // Do something with comments }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` By default, `getAllCommentAnnotations` will return data for the current `documentId` and `location`. If you pass in a `documentId` to `getAllCommentAnnotations` as an argument, it will return all comments in the given `documentId`. If you pass in a `documentId` as the first argument and a `location` object as the second argument, it will return all comments in the given `documentId` and `location`. ```js if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getAllCommentAnnotations('my-document-id', { id:'my-location-id',locationName:"MainVideoPlayer",timestamp:120}).subscribe((comments) => { // Get comments with my-document-id and my-locaiton-id }); } ``` To retrieve all comments in the frontend, call getCommentElement() on the Velt client and then `subscribe()` to `getAllCommentAnnotations()` and pass in a callback function. Whenever there is a change to the comments structure, the callback function will be triggered and will contain all current comments in an array. ```js if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getAllCommentAnnotations().subscribe((comments) => { // Do something with comments }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` By default, `getAllCommentAnnotations` will return data for the current `documentId` and `location`. If you pass in a `documentId` to `getAllCommentAnnotations` as an argument, it will return all comments in the given `documentId`. If you pass in a `documentId` as the first argument and a `location` object as the second argument, it will return all comments in the given `documentId` and `location`. ```js if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getAllCommentAnnotations('my-document-id', { id:'my-location-id',locationName:"MainVideoPlayer",timestamp:120}).subscribe((comments) => { // Get comments with my-document-id and my-locaiton-id }); } ```
## 2. To retrieve comments in the backend For this you should use our Webhook service. Let's say you want to be notified whenever a comment is added or updated, you can provide us an endpoint and we will send the comment data to that end point as and when there is an update. You can then process it further. Note that you cannot retrieve historical comments using this. You can enable and configure webhook in your Velt Console as shown below. After you enable this, you need to provide an endpoint url. We will make a post request to that endpoint to send the comment data. To read more about how to configure webhooks, check out the [webhooks documentation](/webhooks/overview). ## 3. Get Count of Unread CommentAnnotations On Current Document You can get the number of `CommentAnnotations` that have at least 1 unread `Comment` on the current `Document` by using the `useUnreadCommentAnnotationCountOnCurrentDocument()` hook: ```jsx const count = useUnreadCommentAnnotationCountOnCurrentDocument(); useEffect(() => { console.log(count, 'countObj') }, [count]) ``` You can get the number of `CommentAnnotations` that have at least 1 unread `Comment` on the current `Document` by subscribing to the `getUnreadCommentAnnotationCountOnCurrentDocument()` method: ```jsx if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getUnreadCommentAnnotationCountOnCurrentDocument().subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` You can get the number of `CommentAnnotations` that have at least 1 unread `Comment` on the current `Document` by subscribing to the `getUnreadCommentAnnotationCountOnCurrentDocument()` method: ```jsx if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getUnreadCommentAnnotationCountOnCurrentDocument().subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` ## 4. Get Count Of Unread Comments On Current Document You can get the number of unread `Comments` on the current `Document` by using the `useUnreadCommentCountOnCurrentDocument()` hook: ```jsx const count = useUnreadCommentCountOnCurrentDocument(); useEffect(() => { console.log(count, 'countObj') }, [count]) ``` You can get the number of unread `Comments` on the current `Document` by using the `getUnreadCommentCountOnCurrentDocument()` method: ```jsx if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getUnreadCommentCountOnCurrentDocument().subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` You can get the number of unread `Comments` on the current `Document` by using the `getUnreadCommentCountOnCurrentDocument()` method: ```jsx if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getUnreadCommentCountOnCurrentDocument().subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` ## 5. Get Count Of Unread CommentAnnotations By Location Id You can get the number of `CommentAnnotations` with at least 1 unread `Comment` by `Location Id` by using the `useUnreadCommentAnnotationCountByLocationId()` hook: ```jsx const count = useUnreadCommentAnnotationCountByLocationId(locationId); useEffect(() => { console.log(count, 'countObj') }, [count]) ``` You can get the number of `CommentAnnotations` with at least 1 unread `Comment` by `Location Id` by using the `getUnreadCommentAnnotationCountByLocationId` method: ```jsx if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getUnreadCommentAnnotationCountByLocationId(locationId).subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` You can get the number of `CommentAnnotations` with at least 1 unread `Comment` by `Location Id` by using the `getUnreadCommentAnnotationCountByLocationId` method: ```jsx if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getUnreadCommentAnnotationCountByLocationId(locationId).subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` ## 6. Get Count Of Unread Comments By Location Id You can get the number of unread `Comments` by `Location Id` by using the `useUnreadCommentCountByLocationId()` hook: ```jsx const count = useUnreadCommentCountByLocationId(locationId); useEffect(() => { console.log(count, 'countObj') }, [count]) ``` You can get the number of unread `Comments` by `Location Id` by using the `getUnreadCommentCountByLocationId()` method: ```jsx if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getUnreadCommentCountByLocationId(locationId).subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` You can get the number of unread `Comments` by `Location Id` by using the `getUnreadCommentCountByLocationId()` method: ```jsx if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getUnreadCommentCountByLocationId(locationId).subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` ## 7. Get Count Of Unread Comments By Annotation Id You can get the number of unread `Comments` by annotation id by using the `useUnreadCommentCountByAnnotationId()` hook: ```jsx const count = useUnreadCommentCountByAnnotationId(annotationId); useEffect(() => { console.log(count, 'countObj') }, [count]) ``` You can get the number of unread `Comments` by annotation id by subscribing to the `getUnreadCommentCountByAnnotationId()` method: ```jsx if (client) { const commentElement = client.getCommentElement(); let subscription = commentElement.getUnreadCommentCountByAnnotationId(annotationId).subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` You can get the number of unread `Comments` by annotation id by subscribing to the `getUnreadCommentCountByAnnotationId()` method: ```jsx if (Velt) { const commentElement = Velt.getCommentElement(); let subscription = commentElement.getUnreadCommentCountByAnnotationId(annotationId).subscribe((countObj) => { console.log(countObj); }); } ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` ## 8. Get Selected Comments * Get the currently selected comment annotations. * This returns an array of [`CommentAnnotation`](/api-reference/models/CommentAnnotation) objects. ```jsx const commentElement = client.getCommentElement(); const subscription = commentElement.getSelectedComments().subscribe((selectedComments) => { console.log('Selected comments:', selectedComments); }); ``` Unsubscribe from the subscription when you're done: ```jsx subscription?.unsubscribe() ``` ```js const commentElement = Velt.getCommentElement(); const subscription = commentElement.getSelectedComments().subscribe((selectedComments) => { console.log('Selected comments:', selectedComments); }); ``` Unsubscribe from the subscription when you're done: ```js subscription?.unsubscribe() ``` ## 9. Get Comment Annotation by ID * Retrieve a specific comment annotation by its ID. * By default, it will return the comment annotation for the current `documentId`. * If you pass in a `documentId`, it will return the comment annotation for the given `documentId`. Using Hooks: ```jsx const annotation = useCommentAnnotationById({ annotationId: '-O6W3jD0Lz3rxuDuqQFx', // AnnotationID documentId: 'document-id' // DocumentId (Optional) }); useEffect(() => { console.log('annotation', annotation); }, [annotation]); ``` Using API: ```javascript const commentElement = client.getCommentElement(); let subscription = commentElement.getCommentAnnotationById({ annotationId: '-O6W3jD0Lz3rxuDuqQFx', // AnnotationID documentId: 'document-id' // DocumentId (Optional) }).subscribe((annotation) => { console.log('annotation', annotation); }); ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` Using API: ```javascript const commentElement = Velt.getCommentElement(); let subscription = commentElement.getCommentAnnotationById({ annotationId: '-O6W3jD0Lz3rxuDuqQFx', // AnnotationID documentId: 'document-id' // DocumentId (Optional) }).subscribe((annotation) => { console.log('annotation', annotation); }); ``` To unsubscribe from the subscription: ```jsx subscription?.unsubscribe() ``` # Task Management Controls ## 1. AI auto categorization of comments ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/ai-categories.png) Whether AI auto-categorization of comments is enabled. `Default: false` We use AI to analyze your comment content and auto-categorize it so users can filter comments easily. You can provide a list of custom categories that we should use to categorize the comments (shown below). ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableAutoCategorize(); commentElement.disableAutoCategorize(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableAutoCategorize(); commentElement.disableAutoCategorize(); ``` ## 2. Set Custom Categories ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/custom-categories.png) Pass custom categories in the `customCategory` prop. `Default categories: Question, Feedback, Bug, Other.` With custom categories, you can replace the default categories with your own values. These categories are used in the `Comments Sidebar` to filter comments by category. The AI `autoCategorize` feature uses the list of categories to determine the closest category to choose from. The input format to the `customCategory` prop should be an array of objects with an `id`, `name`, and `color`. The `color` property is used to set the category pill background color. ```js ``` Pass custom categories in the `custom-category`. `Default categories: Question, Feedback, Bug, Other.` With custom categories, you can replace the default categories with your own values. These categories are used in the `Comments Sidebar` to filter comments by category. The AI `auto-categorize` uses the list of categories to determine the closest category to choose from. The input format to the `custom-category` should be an array of objects with an `id`, `name`, and `color`. The `color` property is used to set the category pill background color. ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.setCustomCategory([ { "id": "bug", "name": "Bug", "color": "red" } ]) ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.setCustomCategory([ { "id": "bug", "name": "Bug", "color": "red" } ]) ``` Make sure to have at least 2 categories set. ## 3. Priority ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/priority-default.png) Whether to enable setting priority on comments. `Default: false` When this is on, users can assign a priority to each comment & filter comment by priority in the sidebar. You can customize the list of priority options as shown later on this page in the Set Custom Priorities section. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePriority(); commentElement.disablePriority(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enablePriority(); commentElement.disablePriority(); ``` ## 4. Set Custom Priorities ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/custom-priority.png) Pass custom priorities in the `customPriority` prop. `Default priorities: P0, P1, P2` With custom priorities, you can replace the default priorities with your own values. These priorities are also used in the comment sidebar to filter comments by priority. This will work if you have enabled the priority feature. The `color` property is used to set the priority pill background color. The `lightColor` property sets the background color of the filter. ```js ``` Pass custom priorities in the `custom-priority`. `Default priorities: P0, P1, P2` With custom priorities, you can replace the default priorities with your own values. These priorities are also used in the comment sidebar to filter comments by priority. This will work if you have enabled the priority feature. The `color` property is used to set the priority pill background color. The `lightColor` property sets the background color of the filter. ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.setCustomPriority([ { "id": "low", "name": "Low", "color": "red", "lightColor": "pink", }, ]) ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.setCustomPriority([ { "id": "low", "name": "Low", "color": "red", "lightColor": "pink", }, ]) ``` Make sure to have at least 2 categories set. ## 5. Status ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/status-default.png) Whether to enable the default status dropdown & filters. `Default: true` When this is on, users can assign a status to each comment & filter comment by status in the sidebar. You can customize the list of status options as shown below on this page. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableStatus(); commentElement.disableStatus(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableStatus(); commentElement.disableStatus(); ``` ## 6. Set Custom Statuses ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/custom-status.png) Set custom statuses in the `customStatus` prop. `Default statuses: Open, In Progress, Resolved` With custom statuses, you can replace the default statuses with your own values. These statuses are also used in the comment sidebar to filter comments by status. Setting the Status type using the `type` property: * `default`: This will be the default status assigned to each comment. * `ongoing`: This is treated as an intermediary status, you can add as many statuses with type ongoing as you want. * `terminal`: This represents a status that is completed. Comments with this status type are no longer shown in the DOM. Setting the Status Icon using the `svg` property: * You can pass in a serialized SVG. We automatically parse and colorize SVGs. If instead you pass in an icon URL, you will have to colorize each icon yourself to match the status color. ```js " // Pass in a serialized SVG } ]}/> ``` Set custom statuses in the `custom-status` prop. `Default statuses: Open, In Progress, Resolved` With custom statuses, you can replace the default statuses with your own values. These statuses are also used in the comment sidebar to filter comments by status. Setting the Status type using the `type` property: * `default`: This will be the default status assigned to each comment. * `ongoing`: This is treated as an intermediary status, you can add as many statuses with type ongoing as you want. * `terminal`: This represents a status that is completed. Comments with this status type are no longer shown in the DOM. Setting the Status Icon using the `svg` property: * You can pass in a serialized SVG. We automatically parse and colorize SVGs. If instead you pass in an icon URL, you will have to colorize each icon yourself to match the status color. ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.setCustomStatus([ { "id": "open", "name": "Open", "color": "white", "lightColor":"green", "type": "default", "svg": "" // Pass in a serialized SVG } ]) ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.setCustomStatus([ { "id": "open", "name": "Open", "color": "white", "lightColor":"green", "type": "default", "svg": "" // Pass in a serialized SVG } ]) ``` Make sure to have at least 2 categories set. ## 7. Resolve button ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/resolve-button.png) Whether to show resolve button on comments. `Default: true` This adds a tick mark button on the top right corner of the comment dialog. Clicking on this button will mark the comment as resolved. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableResolveButton(); commentElement.disableResolveButton(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableResolveButton(); commentElement.disableResolveButton(); ``` ## 8. Moderator mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/moderator-mode.png) Whether comments require moderator approval. `Default: false` By default, when a user adds a comment it is visible to all authenticated users on the same `document`. Moderator mode makes visibility of all comments private to only `admin` users and the comment author. Admin users will see an approve button on the comment dialog. Once approved the comment will be visible to all users who can access the `document`. You can set some users as `admin` by setting the `isAdmin` property in the User object, during the `identify()` call. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableModeratorMode(); commentElement.disableModeratorMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableModeratorMode(); commentElement.disableModeratorMode(); ``` ## 9. Ability to accept or reject comments ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/accept-reject.png) Whether to enable suggestion mode to accept or reject comments. `Default: false` To accept comments, set the `suggestionMode` attribute to `true`. ```js ``` To accept comments, set the `suggestion-mode` attribute to `true`. ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableSuggestionMode(); commentElement.disableSuggestionMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableSuggestionMode(); commentElement.disableSuggestionMode(); ``` ## 10. Listen to `onCommentAccept` and `onCommentReject` events To listen to comments that are Accepted or Rejected in Suggestion mode, pass callbacks to the `onCommentAccept` and onCommentReject\` event handlers. ```js yourMethod(event)}/> yourMethod(event)}/> ``` ```js const veltCommentsTag = document.querySelector('velt-comments'); veltCommentsTag?.addEventListener('onCommentAccept', (event) => { console.log('*** onCommentAccept ***'); console.log(event.detail); }); veltCommentsTag?.addEventListener('onCommentReject', (event) => { console.log('*** onCommentReject ***'); console.log(event.detail); }); ``` Response: ```js { "annotationId": "ANNOTATION_ID", "actionUser": { // user object }, "actionType": "accept", // accept or reject "annotation": { // raw annotation object }, "replaceContentHtml": "HTML_FORMATTED_TEXT_TO_REPLACE", // optional "replaceContentText": "PLAIN_TEXT_TO_REPLACE", // optional } ``` ## 11. Sign In button ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/sign-in-button.png) Whether to enable Sign In button on comment dialog when user is anonymous or signed out. `Default: false` This allows anonymous or signed out users to still read the comments but encourages them to sign in if they want to respond to the comments. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableSignInButton(); commentElement.disableSignInButton(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableSignInButton(); commentElement.disableSignInButton(); ``` ## 12. onSignIn When the user clicks on the sign in button, we will emit an `onSignIn` event that you can handle with your own sign in method. No data is passed with the event. ```js yourSignInMethod()} /> ``` ```js const veltCommentsTag = document.querySelector('velt-comments'); veltCommentsTag?.addEventListener('onSignIn', (event) => { console.log('*** onCommentSignIn ***'); console.log(event.detail); }); ``` ## 13. Enable/Disable private comment mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/private-comment.png) Whether private comment mode is enabled. `Default: false` Admin users can enable `private comment mode`. Once `private comment mode` is enabled, all the newly added comment annotations by the admin user will be private comments by default, meaning only other admins can see it. To enable private comment mode, set the `privateCommentMode` attribute to `true`: ```html ``` To enable private comment mode, set the `private-comment-mode` attribute to `true`: ```html ``` API Methods: API to enable/disable private comment mode: ```jsx const commentElement = client.getCommentElement(); // To enable private comment mode commentElement.enablePrivateCommentMode(); // To disable private comment mode commentElement.disablePrivateCommentMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); // To enable private comment mode commentElement.enablePrivateCommentMode(); // To disable private comment mode commentElement.disablePrivateCommentMode(); ``` ## 14. Enable Minimap ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/minimap.png) * The minimap shows a bar on the edge of the screen with indicators that show where comments exist. * Use this to enable/disable the minimap. By default it's disabled. * It can be positioned `left` or `right`. By default, it's positioned on the right side of the screen. **Option a. Enable using config:** ```jsx ``` **API Method:** ```jsx const commentElement = client.getCommentElement(); commentElement.enableMinimap(); commentElement.disableMinimap(); ``` ```jsx ``` **API Method:** ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableMinimap(); commentElement.disableMinimap(); ``` **Option b. Enable using Minimap Component:** This offers greater flexibility to customize and position the minimap. ```jsx
{/* scrollable content */}
```
```jsx
```
## 15. Restrict Resolve Action to Admin Users Only * Restrict the resolve action to admin users and the comment author only. **Using props:** ```jsx ``` **Using API:** ```javascript const commentElement = client.getCommentElement(); // To enable resolve status access admin only commentElement.enableResolveStatusAccessAdminOnly(); // To disable resolve status access admin only commentElement.disableResolveStatusAccessAdminOnly(); ``` **Using props:** ```html ``` **Using API:** ```javascript const commentElement = Velt.getCommentElement(); // To enable resolve status access admin only commentElement.enableResolveStatusAccessAdminOnly(); // To disable resolve status access admin only commentElement.disableResolveStatusAccessAdminOnly(); ``` ## 16. Toggle "Seen By" Feature Control whether the "Seen By" feature is enabled for comments. When enabled, it shows which users have seen each comment. Default: `true` **Using Props:** ```jsx ``` **Using API:** ```jsx const commentElement = client.getCommentElement(); commentElement.enableSeenByUsers(); commentElement.disableSeenByUsers(); ``` **Using Props:** ```html ``` **Using API:** ```javascript const commentElement = Velt.getCommentElement(); commentElement.enableSeenByUsers(); commentElement.disableSeenByUsers(); ``` # UI/UX Controls ## 1. Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/dark-light-mode.png) Whether dark mode is enabled. `Default: false` ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ## 2. Mobile Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/mobile-mode.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/mobile-mode-composer.png) Whether mobile mode is enabled. When mobile mode is enabled and the screen width is small enough, comment windows will appear fixed to the bottom of the screen and full width instead of the usual popup window. `Default: false` ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableMobileMode(); commentElement.disableMobileMode(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableMobileMode(); commentElement.disableMobileMode(); ``` ## 3. Enable / Disable Scroll to Comment on Click ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/scroll-on-click.gif) Whether, users will be scrolled to the location of a `Comment` when it is clicked. `Default: true` By default, users will be redirected to a `Comment` if the comment id is provided in the url. But sometimes this experience is annoying, so we have provided a way to disable the option to automatically scroll users to the location of the `Comment`. To disable the feature, set `scrollToComment` to `false`. ```html ``` To disable the feature, set `scroll-to-comment` to `false`. ```html ``` API methods: ```jsx const commentElement = client.getCommentElement(); // To enable scroll to component commentElement.enablescrollToComment(); // To disable scroll to component commentElement.disablescrollToComment(); ``` ```jsx const commentElement = Velt.getCommentElement(); // To enable scroll to component commentElement.enablescrollToComment(); // To disable scroll to component commentElement.disablescrollToComment(); ``` ## 4. Enable pin highlighter outline ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/pin-highlighter-outline.png) Wheter the pin highlighter outline is enabled or not. `Default: true` ```jsx ``` ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); commentElement.enableCommentPinHighlighter(); // to enable comment pin highlight commentElement.disableCommentPinHighlighter(); // to disable comment pin highlight ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableCommentPinHighlighter(); // to enable comment pin highlight commentElement.disableCommentPinHighlighter(); // to disable comment pin highlight ``` ## 5. Disable ShadowDOM Whether the ShadowDOM is enabled or not on certain components. `Default: enabled` By default, a ShadowDOM is used with certain components to ensure that your application's CSS does not interfere with the styling of the SDK components. If you want your application's CSS to affect the styling of the SDK components, you can disable the ShadowDOM. To disable ShadowDOM on all Comment features: ```jsx ``` ```jsx ``` To disable ShadowDOM on individual features: ```jsx ``` ```jsx ``` API methods: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePinShadowDOM(); commentElement.disablePinShadowDOM(); commentElement.enableDialogShadowDOM(); commentElement.disableDialogShadowDOM(); commentElement.enableSidebarShadowDOM(); commentElement.disableSidebarShadowDOM(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enablePinShadowDOM(); commentElement.disablePinShadowDOM(); commentElement.enableDialogShadowDOM(); commentElement.disableDialogShadowDOM(); commentElement.enableSidebarShadowDOM(); commentElement.disableSidebarShadowDOM(); ``` ## 6. Expand Composer to show Attachments Bar By default, the `Composer` in the `Comments Dialog` only shows the text input box and does not show the actions bar until the `Composer` is clicked on or the user starts typing. You can modify this behavior by setting the `Composer Mode` prop to `"expanded"`. This will make the actions bar always visible. To keep the default behavior you can set the property to `"default"`. `Default: "default"` ```jsx ``` ```jsx ``` ## 7. Set Custom Cursor You can set custom mouse cursor when the comment mode is on. The custom cursor image must be **32 x 32 pixels**. ```jsx ``` ```jsx ``` API Methods: ```jsx const commentElement = client.getCommentElement(); commentElement.setPinCursorImage(BASE64_IMAGE_STRING); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.setPinCursorImage(BASE64_IMAGE_STRING); ``` ## 8. Show/Hide comments on DOM Whether comments are shown on the DOM. `Default: true` By default, all the comments will be visible on DOM whenever we are able to detect to elements for that. But users can hide it from DOM if required. There are 2 ways to show/hide comments on DOM: Configuring attributes on the React Component: ```js {/* `true` to show comments, `false` to hide comments */} ``` ```js ``` Using API methods: ```js const commentElement = client.getCommentElement(); // to show comments on DOM commentElement.showCommentsOnDom(); // to hide comments on DOM commentElement.hideCommentsOnDom(); ``` ```js const commentElement = Velt.getCommentElement(); // to show comments on DOM commentElement.showCommentsOnDom(); // to hide comments on DOM commentElement.hideCommentsOnDom(); ``` ## 9. Comment dialog on hover ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/show-dialog-on-hover.gif) Whether the comment dialog shows on hover over the comment pin or the target element. `Default: true` ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDialogOnHover(); commentElement.disableDialogOnHover(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDialogOnHover(); commentElement.disableDialogOnHover(); ``` ## 10. Comment dialog on target element click ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/hover-cell-comment.gif) Whether the comment dialog opens when target element is clicked. This is relevant only for Popover mode. `Default: true` ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDialogOnTargetElementClick(); commentElement.disableDialogOnTargetElementClick(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDialogOnTargetElementClick(); commentElement.disableDialogOnTargetElementClick(); ``` ## 11. Floating comment dialog ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/floating-comment-dialog.gif) Whether floating comment dialog is shown next to comment pin on hover or click. `Default: true` ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableFloatingCommentDialog(); commentElement.disableFloatingCommentDialog(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableFloatingCommentDialog(); commentElement.disableFloatingCommentDialog(); ``` ## 12. Enable Popover mode triangle Whether the popover triangle appears when Popover Mode is enabled. `Default: true` ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enablePopoverTriangleComponent(); commentElement.disablePopoverTriangleComponent(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enablePopoverTriangleComponent(); commentElement.disablePopoverTriangleComponent(); ``` ## 13. Show resolved comments on DOM Whether to show resolved comments on the DOM. `Default: false` ```jsx ``` ```html ``` API Methods: ```jsx const commentElement = client.getCommentElement(); // To show resolved comments on dom commentElement.showResolvedCommentsOnDom(); // To hide resolved comments on dom commentElement.hideResolvedCommentsOnDom(); ``` ```jsx const commentElement = Velt.getCommentElement(); // To show resolved comments on dom commentElement.showResolvedCommentsOnDom(); // To hide resolved comments on dom commentElement.hideResolvedCommentsOnDom(); ``` ## 14. Comment index ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/index-indicator.png) Whether comment index is enabled. `Default: false` This appears in the comment sidebar and on the comment pins. When this is on, we show a small icon indicating the comment index in the order of creation date. This enables users to find and navigate to the desired comment quickly. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableCommentIndex(); commentElement.disableCommentIndex(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableCommentIndex(); commentElement.disableCommentIndex(); ``` ## 15. Device Type Info ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/device-info.png) Whether device type indicator is enabled. `Default: false` When this is on, we show additional information in the `Comment Thread` indicating which device the comment was created on. This is useful especially for design tools, where additional context is needed for debugging issues. ```js ``` ```js ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDeviceInfo(); commentElement.disableDeviceInfo(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDeviceInfo(); commentElement.disableDeviceInfo(); ``` ## 16. Device Indicator on Comment Pins ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/device-info-pin.png) Whether the device type indicator on `Comment Pins` is enabled. `Default: false` When this is on, we show a small device type icon on the `Comment Pin` indicating which device the comment was created on. This is useful especially for design tools, where additional context is needed for debugging issues. ```js ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.enableDeviceIndicatorOnCommentPins(); commentElement.disableDeviceIndicatorOnCommentPins(); ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDeviceIndicatorOnCommentPins(); commentElement.disableDeviceIndicatorOnCommentPins(); ``` ## 17. Enable Verbose Mode for Unread Comments Whether `verbose` mode is enabled for unread `Comments`. `Default: 'minimal'` Unread `Comments` can be in `minimal` mode or `verbose` mode. In `minimal` mode, a small red dot indicator appears for unread `Comments`. In `verbose` mode, a larger badge with the text "UNREAD" will appear for unread `Comments`. ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/unread-compare.png) ```jsx ``` ```jsx ``` API Method: ```jsx const commentElement = client.getCommentElement(); commentElement.setUnreadIndicatorMode("verbose"); // use badge with text UNREAD commentElement.setUnreadIndicatorMode("minimal"); // use small red dot indicator ``` ```jsx const commentElement = Velt.getCommentElement(); commentElement.setUnreadIndicatorMode("verbose"); // use badge with text UNREAD commentElement.setUnreadIndicatorMode("minimal"); // use small red dot indicator ``` ## 18. Show Unread Comments Count on Comment Bubble Component Whether to show unread or total comment replies count on Comment Bubble Component. `Default: 'total'` ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/popover-bubble.png) `commentCountType`: This prop allows you to decide which count to display. * `total`: Shows the total number of replies. (default) * `unread`: Shows the number of unread replies. ```jsx ``` `comment-count-type`: This prop allows you to decide which count to display. * `total`: Shows the total number of replies. (default) * `unread`: Shows the number of unread replies. ```jsx ``` ## 19. Enable Comment Bubble on Comment Pin Show a Comment Bubble when user hovers or clicks on the Comment Pin vs showing the Comment Dialog. The comment dialog will open only on clicking the comment bubble. `Default: 'false'` **Using Props:** ```jsx ``` **Using API Method:** ```jsx const commentElement = useCommentUtils(); commentElement.enableBubbleOnPin(); commentElement.disableBubbleOnPin(); ``` **Using Props:** ```jsx ``` **Using API Method:** ```jsx const commentElement = client.getCommentElement(); commentElement.enableBubbleOnPin(); commentElement.disableBubbleOnPin(); ``` **Using Props:** ```jsx ``` **Using API Method:** ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableBubbleOnPin(); commentElement.disableBubbleOnPin(); ``` ## 20. Enable showing Comment Bubble when hovering on the Comment Pin Show a Comment Bubble when user hovers on the Comment Pin vs clicks on it. `Default: 'true'` **Using Props:** ```jsx ``` **Using API Method:** ```jsx const commentElement = useCommentUtils(); // To enable/disable showing bubble on pin commentElement.enableBubbleOnPin(); commentElement.disableBubbleOnPin(); // To enable/disable showing bubble on hover commentElement.enableBubbleOnPinHover(); commentElement.disableBubbleOnPinHover(); ``` **Using Props:** ```jsx ``` **Using API Method:** ```jsx const commentElement = client.getCommentElement(); // To enable/disable showing bubble on pin commentElement.enableBubbleOnPin(); commentElement.disableBubbleOnPin(); // To enable/disable showing bubble on hover commentElement.enableBubbleOnPinHover(); commentElement.disableBubbleOnPinHover(); ``` **Using Props:** ```jsx ``` **Using API Method:** ```jsx const commentElement = Velt.getCommentElement(); // To enable/disable showing bubble on pin commentElement.enableBubbleOnPin(); commentElement.disableBubbleOnPin(); // To enable/disable showing bubble on hover commentElement.enableBubbleOnPinHover(); commentElement.disableBubbleOnPinHover(); ``` ## 21. Control Collapsed Comments You can control whether comments inside the annotation should be collapsed. `Default: true` Using Props: ```jsx ``` Using API: ```javascript const commentElement = client.getCommentElement(); // To enable collapsed comments commentElement.enableCollapsedComments(); // To disable collapsed comments commentElement.disableCollapsedComments(); ``` Using Props: ```html ``` Using API: ```javascript const commentElement = Velt.getCommentElement(); // To enable collapsed comments commentElement.enableCollapsedComments(); // To disable collapsed comments commentElement.disableCollapsedComments(); ``` ## 22. Enable/Disable Short User Names You can control whether long user names should be shortened. For long names, this will first create an initial of the second name and if the name is still long, it will truncate it with ellipses. Default: `true` **Using Props:** ```jsx ``` **Using API:** ```javascript const commentElement = client.getCommentElement(); commentElement.enableShortUserName(); commentElement.disableShortUserName(); ``` **Using Props:** ```html ``` **Using API:** ```javascript const commentElement = Velt.getCommentElement(); commentElement.enableShortUserName(); commentElement.disableShortUserName(); ``` # Overview This button shows the comment count and the author's avatar. This is used in Popover comments feature. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default comment bubble component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/comment-bubble-light.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ### Example ```jsx ``` ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-bubble-1.png) By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. `Default: false` Below are examples to enable dark mode for comment bubble component. ### Example ```js ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ### Example ```HTML ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` # null The subcomponent on the Comment Bubble that shows the User avatar We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-bubble-sub-2.png) This subcomponent does not support children ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Comment Bubble that shows the number of Comments made on a thread. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-bubble-sub-1.png) This subcomponent does not support children ```jsx React / Next.js ``` ```HTML HTML ``` # Overview The interface that appears when you try to read an existing Comment or make a new Comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default comment dialog component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-1.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-2.png) ```jsx React / Next.js {/* Ghost Banner - Only shown for ghost comments */} {/* Private Banner - Only shown for private comments */} {/* Assignee Banner - Only shown for assigned comments */} {/* Header */} {/* Private Badge - Only shown for private comments */} {/* Body */} {/* Composer */} {/* All Comments */} {/* Approve - Only when moderator mode is on */} {/* Sign In - Only when user is anonymous and sign in button is enabled */} {/* Upgrade - Not visible by default */} {/* Suggestion Action - Only when suggestion mode is on */} ``` ```HTML HTML ``` # Variants ## Pre-defined Variants The Comment Dialog has 2 pre-defined variants: * `dialog`: this will customize the Comment Dialog only within Pin, Area, and Text Comments * `sidebar`: this will customize the Comment Dialog only within Sidebar comments To use them, set the `variant` name in the wireframe template equal to one of the pre-defined variants. You do not need to add it to the actual Velt component. ```jsx React / Next.js {/* This pre-defined variant will change the appearance of the Comment Dialog within Pin, Area, and Text comments only */} ... {/* This pre-defined variant will change the appearance of the Comment Dialog within the Sidebar only */} ... {/* If you dont use any variants, then customization will be applied to the Comment Dialog globally */} ... ``` ```jsx HTML ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enableDialogShadowDOM(); commentElement.disableDialogShadowDOM(); ``` ### Example ``` ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDialogShadowDOM(); commentElement.disableDialogShadowDOM(); ``` ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/dark-light-mode.png) By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. `Default: false` Below are the examples to enable Dark Mode for comments dialog: ### Example ```js ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ### Example ```js ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` # null The subcomponent of the Comment Dialog that is used to show the All Comments button that opens the Comments Sidebar We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any of the components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-8.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that is used approve Comments in Moderator Mode We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-9.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that is used assign a Comment as a task We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-3.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.AssigneeBanner.UserAvatar` * `VeltCommentDialogWireframe.AssigneeBanner.UserName` * `velt-comment-dialog-assignee-banner-user-avatar-wireframe` * `velt-comment-dialog-assignee-banner-user-name-wireframe` ```jsx "React / Next.js" ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the tooltip that appears when you hover over an Autocomplete Chip. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/autocomplete-chip-tooltip.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the dropdown list that appears when you press an Autocomplete hotkey. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-user-selector-dropdown-1.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-user-selector-dropdown-2.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Overview The subcomponent of the Comment Dialog that is used to show all Comment Replies as well as the Comment Composer. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-6.png) ```jsx React / Next.js ``` ```HTML HTML ... ... ``` # ThreadCard The subcomponent of the Body of the Comment Dialog that is used to show attachments added to a Comment reply. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/threadcard-attachments.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.ThreadCard.Avatar` * `VeltCommentDialogWireframe.ThreadCard.DeviceType` * `VeltCommentDialogWireframe.ThreadCard.Name` * `VeltCommentDialogWireframe.ThreadCard.Time` * `VeltCommentDialogWireframe.ThreadCard.Message` * `VeltCommentDialogWireframe.ThreadCard.ReactionTool` * `VeltCommentDialogWireframe.ThreadCard.Reactions` * `VeltCommentDialogWireframe.ThreadCard.Recordings` ## Subcomponents that don't support children * `velt-comment-dialog-thread-card-avatar-wireframe` * `velt-comment-dialog-thread-card-device-type-wireframe>` * `velt-comment-dialog-thread-card-name-wireframe` * `velt-comment-dialog-thread-card-time-wireframe` * `velt-comment-dialog-thread-card-message-wireframe` * `velt-comment-dialog-thread-card-reaction-tool-wireframe` * `velt-comment-dialog-thread-card-reactions-wireframe` * `velt-comment-dialog-thread-card-recordings-wireframe` ```jsx React / Next.js {/* Unread indicator */} {/* Seen indicator with dropdown */} {/* Draft indicator */} ... customizable ``` ```HTML HTML ... customizable ``` # ThreadCard Attachments The subcomponent of the Body of the Comment Dialog that is used to show attachments added to a Comment reply. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/threadcard-attachments.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.ThreadCard.Attachments.Image.Preview` * `VeltCommentDialogWireframe.ThreadCard.Attachments.Other.Name` * `VeltCommentDialogWireframe.ThreadCard.Attachments.Other.Size` * `velt-comment-dialog-thread-card-attachments-image-preview-wireframe` * `velt-comment-dialog-thread-card-attachments-other-name-wireframe` * `velt-comment-dialog-thread-card-attachments-other-size-wireframe` ```jsx React / Next.js ``` ```HTML HTML ``` # ThreadCard Options The subcomponent of the Body of the Comment Dialog that is used to show the options dropdown We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/threadcard-options.png) ```jsx React / Next.js ``` ```HTML HTML ``` # ThreadCard Seen We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/seen-feature.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Overview The subcomponent of the Comment Dialog that is used to compose new Comment replies. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. When the composer is in focus, a dynamic CSS class `velt-composer-focused` is added to the composer container. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-7.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.Composer.Recordings` * `VeltCommentDialogWireframe.Composer.Input` * `VeltCommentDialogWireframe.Composer.AssignUser` * `velt-comment-dialog-composer-recordings-wireframe` * `velt-comment-dialog-composer-input-wireframe` * `velt-comment-dialog-composer-assign-user-wireframe` ```jsx React / Next.js {/* used for inline comments */} ... customizable ``` ```HTML HTML ... customizable ``` # Composer Attachments The subcomponent of the Comoposer of the Comment Dialog that is used to show attachments on a Comment that has been composed but hasn't been sent yet. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/composer-attachments.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.Composer.Attachments.Selected.Image.Preview` * `VeltCommentDialogWireframe.Composer.Attachments.Selected.Other.Name` * `VeltCommentDialogWireframe.Composer.Attachments.Selected.Other.Size` * `VeltCommentDialogWireframe.Composer.Attachments.Invalid.Item.Preview` * `velt-comment-dialog-composer-attachments-image-preview-wireframe` * `velt-comment-dialog-composer-attachments-other-name-wireframe` * `velt-comment-dialog-composer-attachments-other-size-wireframe` * `velt-comment-dialog-composer-attachments-invalid-item-preview-wireframe` ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that is shown in the Composer when Private Mode is turned on. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-5.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Custom Annotation Dropdown The subcomponent of the Comment Dialog that represents the custom annotation dropdown. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/comments-dialog-annotation.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/gifs/comments-dialog-annotation-breakdown.png) ```jsx React / Next.js Select a category ``` ```HTML HTML Select a category ``` # null The subcomponent of the Comment Dialog that indicates if a Comment has become a Ghost Comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-2.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Header. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-4.png) ```jsx React / Next.js {/* Following subcomponents can be used outside header as well */} {/* Pin Dialog Header */} {/* Sidebar Dialog Header */} {/* Navigation Button - Only shown on sidebar when focused thread mode is on */} {/* Delete Button. Not added to the default components. You can explicitly add it. */} ``` ```HTML HTML ``` # null Navigation button that appears on sidebar. Clicking on it will navigate to the comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Options Dropdown We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/options-dropdown-customization.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Priority Dropdown We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/priority-dropdown-customization.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.Priority.Trigger.Name` * `VeltCommentDialogWireframe.Priority.Content.Item.Name` * `` * `` ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that is shown near the Header when the Comment is a Private Comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-1.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the the Reaction Pin that appears after a User selects a Reaction. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/reaction-pin-customization.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the tooltip that appears when a User hovers over a Reaction We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/reaction-tooltip-customization.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the button used to add a Reaction We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/reaction-tool-customization.png) ```jsx React / Next.js # Your custom element ``` ```HTML HTML # Your custom element ``` # null The subcomponent of the Comment Dialog that represents the panel of all Reactions that have been added to a Comment We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/reaction-panel-customization.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Sign In button that appears when a User is a Guest User We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-10.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Status Dropdown We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/status-dropdown-customization.png) ## Subcomponents that don't support children * `VeltCommentDialogWireframe.Status.Trigger.Name` * `VeltCommentDialogWireframe.Status.Content.Item.Name` * `` * `` ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Accept or Reject button is Moderator Mode. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-12.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Comment Dialog that represents the Upgrade button. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-dialog-sub-11.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Overview The Pin that appears on the DOM when you place a Comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default comment pin component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/comment-pin-light.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/comment-pin-all-states-light.png) ```jsx React / Next.js {/* Ghost Comment Indicator */} {/* Index */} {/* Private Comment Indicator */} {/* Triangle */} {/* Unread Comment Indicator */} ``` ```HTML HTML ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enablePinShadowDOM(); commentElement.disablePinShadowDOM(); ``` ### Example ```jsx ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enablePinShadowDOM(); commentElement.disablePinShadowDOM(); ``` ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-pin-1.png) ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-pin-2.png) By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. `Default: false` Below are the examples to enable Dark Mode for comments pin: ### Example ```js ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ### Example ```js ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` # null The subcomponent on the Comment Pin that indicates whether the Comment is a Ghost Comment We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/Ghost_comments.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Comment Pin that indicates the index number of the Comment We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/Index_counter.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Comment Pin that indicates whether the Comment is a Private Comment We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/Private_comments.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Comment Pin that appears as a triangle in the top right corner of a Popover Comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/Cell_indicator.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Comment Pin that indicates whether a Comment hasn't been read yet by the User. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/Unread_indicator.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ```jsx ``` # Overview The button to add new comments. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default comment tool component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/comment-tool-light.png) ```jsx React / Next.js # Your custom element ``` ```HTML HTML # Your custom element ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ```jsx ``` ```jsx ``` ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-comment-tool-1.png) `Default: false` ```js ``` ```js ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ```jsx ``` # Overview The Confirmation Dialog that appears when you delete a comment annotation. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default confirmation dialog component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/confirmation-dialog.png) ## Subcomponents that don't support children * `VeltConfirmDialogWireframe.Title` * `VeltConfirmDialogWireframe.Message` * `velt-confirm-dialog-title-wireframe` * `velt-confirm-dialog-message-wireframe` ```jsx React / Next.js ``` ```HTML HTML ``` # Styling ## Disable ShadowDOM ShadowDOM is not used in this component. You can apply your styling directly to the component. ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/async-collaboration/comments/customize-ui/confirm-dialog/images/customization/confirmation-dialog-dark.png) This component takes the dark mode property from the parent feature (eg: comments) where this used. If the parent feature component is in dark mode, this component will also be in dark mode. # Overview Components that appear when using Inline Comments We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default inline comment component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/inline-comments-overview.png) ## Subcomponents that don't support children * `VeltInlineCommentsSectionWireframe.CommentCount` * `velt-inline-comments-section-comment-count-wireframe` ```jsx React / Next.js ``` ```HTML HTML ``` # Variants ## Pre-defined Variants This has two pre-deinfed variants: 1. `dialog-variant`: Use this to customize the `Comment Dialog` that appears within the `Inline Comments Section` component. 2. `variant`: Use this to customize the entire `Inline Comments Section` component itself. ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Inline Comments Section that contains the Comment Count We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/inline-comments-count.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Inline Comments Section that contains the Composer Container We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/inline-comments-composer.png) You can customize the Comment Dialog that appears in the Inline Comments Section by adding a Comment Dialog Wireframe inside this subcomponent and modifying it to your liking. ```jsx React / Next.js ...Custom Composer ``` ```HTML HTML ...Custom Composer ``` # null The subcomponent of the Inline Comments Section that contains the List We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/inline-comments-list.png) You can customize the Comment Dialog that appears in the List of the Inline Comments Section by adding a Comment Dialog Wireframe inside this subcomponent and modifying it to your liking. ```jsx React / Next.js ...Custom Dialog ``` ```HTML HTML ...Custom Dialog ``` # null The subcomponent of the Inline Comments Section that contains the Panel We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/async-collaboration/comments/customize-ui/inline-comments-section/subcomponents/panel/images/inline-comments-breakdown.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent of the Inline Comments Section that contains the Skeleton loader that appears when the Inline Comments Section is first loading. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default skeleton subcomponent looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/async-collaboration/comments/customize-ui/inline-comments-section/subcomponents/images/inline-comments-loading.png) ```jsx React / Next.js ``` ```HTML HTML ``` # Overview We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ```jsx React / Next.js ``` ```HTML HTML ``` # Overview The persistent comment mode banner that appears when persistent mode is enabled and user is adding a comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ```jsx React / Next.js ``` ```HTML HTML ``` # Overview The Comment Tool that appears when you highlight some text. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default text comment tool component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/text-comment-light.png) ```jsx React / Next.js # Your custom element ``` ```HTML HTML # Your custom element ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ### Example ```jsx ``` ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/velt-text-comment-1.png) By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. `Default: false` Below are the examples to enable Dark Mode for text comment tool. ### Example ```js ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ### Example ```js ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` # Overview The Toolbar that appears when you highlight some text We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Component Here's how the default text comment toolbar component looks like: ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/text-comment-toolbar-light.png) There are 4 `Subcomponents` within the `Text Comment Toolbar` component. ```jsx React / Next.js ``` ```HTML HTML ``` # Styling ## Disable ShadowDOM * By default, ShadowDOM is used to ensure that your app's CSS does not interfere with the styling of the SDK components. * Disable the shadow dom to apply your custom CSS to the component. `Default: true` ### Example ```jsx ``` ### Example ```jsx ``` ## Dark Mode ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/text-comment-toolbar-dark.png) By default, all components are in Light Mode, but there are several properties and methods to enable Dark Mode. `Default: false` Below are the examples to enable Dark Mode for text comment toolbar. ### Example ```jsx ``` ### API methods ```jsx const commentElement = client.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` ### Example ```jsx ``` ### API methods ```jsx const commentElement = Velt.getCommentElement(); commentElement.enableDarkMode(); commentElement.disableDarkMode(); ``` # null The subcomponent on the Text Comment Toolbar that is used to add a new Text Comment. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/text-comment-toolbar-sub-1.png) ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Text Comment Toolbar that is used to rewrite text on the page using AI. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/text-comment-toolbar-sub-3.png) This subcomponent does not support children ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Text Comment Toolbar that is used to divide other subcomponents in the UI using a thin line. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/text-comment-toolbar-sub-2.png) This subcomponent does not support children ```jsx React / Next.js ``` ```HTML HTML ``` # null The subcomponent on the Text Comment Toolbar that is used to query ChatGPT. We recommend that you familiarize yourselves with [UI Customization Concepts](/advanced-customization/overview) before attempting to modify any components. ## Default Subcomponent ![](https://mintlify.s3-us-west-1.amazonaws.com/velt/images/customization/text-comment-toolbar-sub-4.png) This subcomponent does not support children ```jsx React / Next.js ``` ```HTML HTML ``` # Notifications There are several options to send notifications to your users. Add notifications component within your app. Send email notifications to your users. Send notifications to other channels like Slack. # Comments Your users can add comments in context to ask questions, leave feedback, report bugs etc. We handle all complexity to ensure the comments are robust against content changes. We support many types of comment UX patterns as illustrated below. With `Freestyle` comments, you can pin `Comments` on any elements on the page or draw area comments. [Open in larger window](https://landing-page-demo-velt.vercel.app/?feature=comments\&type=freestyle) */}