Removes the SDK panel and Portable Text wrapper
Published: November 17, 2026
Comment data and the UI are now separate: @sanity/collaboration/sdk exports only SDKCommentsProvider, and the panel and Portable Text editor come from @sanity/collaboration/ui. If you use the SDK panel, the SDK Portable Text wrapper, or drive CommentsPanel yourself, update your code when you upgrade.
Action required
- Who's affected: apps that import
SDKCommentsPanel,SDKPortableTextCommentsoruseSDKThreadCallbacksfrom@sanity/collaboration/sdk, or that passthreads,threadPropsoronThreadCreatetoCommentsPanel. - What to do: pass the document to
SDKCommentsProviderand renderCommentsPanelorPortableTextCommentsfrom@sanity/collaboration/uiinside it, then rename the props listed below. - By when: when you upgrade to 0.5.0. The removed exports and props no longer exist, so code that uses them fails to build.
Migrate the SDK panel
// Before
import {SDKCommentsPanel, SDKCommentsProvider} from '@sanity/collaboration/sdk'
export function Comments() {
return (
<SDKCommentsProvider>
<SDKCommentsPanel
documentId="post-1"
documentType="post"
compose={{fieldPath: 'title'}}
/>
</SDKCommentsProvider>
)
}// After
import {SDKCommentsProvider} from '@sanity/collaboration/sdk'
import {CommentsPanel} from '@sanity/collaboration/ui'
export function Comments() {
return (
<SDKCommentsProvider
document={{documentId: 'post-1', documentType: 'post'}}
>
<CommentsPanel compose={{fieldPath: 'title'}} />
</SDKCommentsProvider>
)
}Migrate the SDK Portable Text wrapper
// Before
import {
SDKCommentsProvider,
SDKPortableTextComments,
} from '@sanity/collaboration/sdk'
export function Editor() {
return (
<SDKCommentsProvider>
<SDKPortableTextComments
documentId="post-1"
documentType="post"
path="body"
/>
</SDKCommentsProvider>
)
}// After
import {SDKCommentsProvider} from '@sanity/collaboration/sdk'
import {PortableTextComments} from '@sanity/collaboration/ui'
export function Editor() {
return (
<SDKCommentsProvider
document={{documentId: 'post-1', documentType: 'post'}}
>
<PortableTextComments path="body" />
</SDKCommentsProvider>
)
}Under a drafts perspective, pass the draft ID, such as documentId: 'drafts.post-1', in the provider's document. With the published ID, the editor also moves the anchors of published comments.
Removed and renamed props
SDKCommentsPanel, SDKPortableTextComments and useSDKThreadCallbacks are removed, along with SDKCommentsPanelProps, SDKPortableTextCommentsProps and the SDKThread* types. context and onCommentCreated move to SDKCommentsProvider, and its onError replaces onRangeChangeError.
If you drive CommentsPanel yourself, pass a flat comments list, on the panel or on CommentsProvider, instead of pre-built threads. Include each reply's parent: a reply whose parent isn't in the list isn't shown. Pass write overrides on CommentsPanel or CommentThread instead of threadProps. Rename write props wherever you pass them:
onThreadCreateisonCreate, on the provider or the panel.onEditisonUpdate, andonDeleteisonRemove.commentActionsstill takesonEditandonDelete.onReactionToggle(shortName, active)isonReactionAdd(shortName)andonReactionRemove(shortName).onRangeChangeisonAnchorChange.
Error and loading behavior
With SDKCommentsProvider, a failed create is reported to onError and the composer clears. This is new for inline comments, whose composer used to keep the text. When the SDK has stored the comment, it stays on screen with createError and can be retried. A create that throws before anything is stored, such as when no user is logged in, saves nothing, and the text is lost. A failed reply is also reported to onError.
On CommentsProvider, a failed onCreate or onReply is reported to onError (default console.error) and then rejects, so the composer keeps the draft.
SDKCommentsProvider still suspends until the viewer resolves. Comments don't suspend: loading is true until they arrive.
Improvements
InlineCommentInput: Escape or Cancel closes the composer and restores the selection and the Comment button. If you've typed a draft, it asks before discarding it; passinputProps={{confirmDiscard: false}}to skip the question. Custom composers can callauthoring.cancel({restoreSelection: true})for the same behavior.
Related documentation
Comments in the App SDK
Read and write Sanity comments with the App SDK collaboration API: documents, fields, threads and live lists.
Inline comments
How an inline comment anchors to a run of Portable Text and keeps its highlight on the same words as the text changes.
Comment navigation and deep links
How CommentsProvider keeps one active comment address that makes comments addressable, revealable, and linkable.
Design principles of the comment components
Six promises the comment components make, and what each one means for the code you write.
Comment components
What each comment component is responsible for, how they nest, and what changes when you compose the primitives yourself.
Customize comment actions
Add, remove, and reorder the actions on a comment with commentActions and CommentActionBar.
Anchor inline comments
Write an inline comment anchored to Portable Text with the App SDK, and re-anchor it when the text moves.
Get started with comments
Install @sanity/collaboration, connect it to the Sanity App SDK, and render a working comments panel on one document.
Link to a comment
Make a shared link open the comments panel on the comment it names, with wiring for each common router.
Levels of abstraction in the comment stack
The two ladders of the collaboration stack, what renders and where data comes from, and what each rung trades.
Build a custom comment
Build your own comment card from the primitives the default Comment uses, keeping its behavior and accessibility.
Use comments in Next.js
Render the comments panel in the Next.js App Router: the client boundary, the stylesheet import, and the styled-components setup.
Users and identity
Why comments store user IDs, how names and avatars are looked up at render time, and where the user directory comes from.
Theme the comment components
Change how the comment components look through the Sanity UI theme, a few typed props, and composition.
SDK-wired comment components
What `SDKCommentsProvider` does, and when to drop down to the SDK hooks.
Show a comment preview
Show one comment in a popover from a badge or a highlighted range, and make a comments panel read-only.
Translate the UI text
Replace every string the comment components render with the labels on the provider and on each component.
Comment data flow
How comment data reaches the components, and how the provider wires the writes.
Customize inline comments
Common ways to change what PortableTextComments does once inline comments are wired into your editor.
Comment on Portable Text
Add inline comments to a Portable Text editor: highlights under the commented words, linked to the comments panel.
Introduction to the comment components
React components for comment threads on Sanity documents: replies, mentions, reactions, resolve, and deep links, rendering data from the App SDK.
Threads and comments
How comment threads are shaped: one field of one document, a first comment plus replies, and no separate thread record.
Show comment counts
Show a comment count next to a field or row with CommentBadge, read the counts efficiently, and open a thread from the badge.