Comments
Discuss tasks, orders, and other records. Comments stay attached to the record across Grid, Kanban, Gallery, Calendar, and Gantt views; switching views does not create a separate discussion.
Register the plugins
Add these after the Bases core and UI plugins:
pnpm add @univerjs-pro/bases-thread-comment @univerjs-pro/bases-thread-comment-uinpm install @univerjs-pro/bases-thread-comment @univerjs-pro/bases-thread-comment-uiyarn add @univerjs-pro/bases-thread-comment @univerjs-pro/bases-thread-comment-uibun add @univerjs-pro/bases-thread-comment @univerjs-pro/bases-thread-comment-uiimport { UniverBasesThreadCommentPlugin } from '@univerjs-pro/bases-thread-comment'import { UniverBasesThreadCommentUIPlugin } from '@univerjs-pro/bases-thread-comment-ui'import '@univerjs-pro/bases-thread-comment/facade'import '@univerjs/thread-comment/facade'import '@univerjs-pro/bases-thread-comment-ui/lib/index.css'univer.registerPlugin(UniverBasesThreadCommentPlugin)univer.registerPlugin(UniverBasesThreadCommentUIPlugin)Merge the comment packages' locale resources and configure the current application user. The UI plugin adds record comment controls; the data plugin associates comments with records.
Add and read comments
const record = univerAPI.getActiveBase()?.getTables()[0]?.getRecords()[0]if (!record) throw new Error('Create a record first')await record.createCommentAsync('Please confirm the delivery date.')const comments = record.getComments()console.log(comments.map(({ root }) => root.id))getComments() reads locally loaded comments. With a remote data source, await record.listCommentsAsync() synchronizes known threads before returning them. See comment Facade for replies, updates, and deletion.
Saving and shared discussions
Local comments can be saved as Base resources through base.save(). Register the comment plugins before restoring a snapshot.
Shared discussions also need a comment service, data source, and permissions. Document collaboration alone does not connect comments. Follow Office extension modules, then test creation, reading, permissions, and reopening with two accounts.
Shared comment operations
Import both the shared comment Facade and the product Facade before calling these methods. Product helpers create stable anchors; the shared API handles replies, updates, resolution, and deletion. getComments() reads local state. listCommentsAsync() synchronizes already known threads through the configured data source; it does not discover every thread on the server.
import '@univerjs/thread-comment/facade'const [thread] = univerAPI.getComments({ resolved: false })if (thread) { await univerAPI.replyCommentAsync({ unitId: thread.unitId, subUnitId: thread.subUnitId, threadId: thread.threadId, content: 'Reviewed.', })}Shared discussions
For shared discussions, integrate the Comment Service and Endpoint with Server SDK, then register UniverThreadCommentDataSourcePlugin from @univerjs-pro/thread-comment-datasource after collaboration and license setup. The supplied data source uses /universer-api/comment/unit/{unitId}/... and /universer-api/user/list; expose those routes through your application. Server permissions must cover comment reads and writes independently of document editing.
How is this guide?