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
Inline comments
Comment navigation and deep links
Design principles of the comment components
Comment components
Customize comment actions
Anchor inline comments
Get started with comments
Link to a comment
Levels of abstraction in the comment stack
Build a custom comment
Use comments in Next.js
Users and identity
Theme the comment components
SDK-wired comment components
Show a comment preview
Translate the UI text
Comment data flow
Customize inline comments
Comment on Portable Text
Introduction to the comment components
Threads and comments
Show comment counts