New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@sanity/collaboration

Package Overview
Dependencies
Maintainers
120
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/collaboration

React components for commenting on Sanity content: threads, replies, mentions, reactions, and inline comments on Portable Text

Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
730
4766.67%
Maintainers
120
Weekly downloads
 
Created
Source

@sanity/collaboration

React components for commenting on Sanity content: a comments panel with threads, replies, mentions and reactions, plus inline comments on a Portable Text field.

The documentation is on sanity.io: Collaboration. Start with Get started.

[!NOTE] The package is in beta, on 0.x. A 0.x minor can contain breaking changes, so check the changelog before you upgrade.

Install

pnpm add @sanity/collaboration

Required peers: react, react-dom, @sanity/ui v4, styled-components, @sanity/icons and @portabletext/editor. @sanity/sdk and @sanity/sdk-react are optional peers, needed only for the /sdk entry point, which requires version 3.11.0 or later. The exact ranges are in package.json.

Styles and theme

Import the Sanity UI stylesheet once, and render the components inside a Sanity UI ThemeProvider. A Studio already has one.

import '@sanity/ui/styles.css'

Entry points

ImportContains
@sanity/collaborationData types and pure helpers. No React, no SDK.
@sanity/collaboration/uiComponents and hooks that take data and callbacks as props.
@sanity/collaboration/sdkThe same components wired to Sanity through @sanity/sdk-react.

The root and /ui never import the SDK, so they work without it installed.

Example

import {SDKCommentsPanel, SDKCommentsProvider} from '@sanity/collaboration/sdk'
import {Suspense} from 'react'

export function Comments() {
  return (
    <Suspense fallback={<p>Loading comments…</p>}>
      <SDKCommentsProvider>
        <SDKCommentsPanel
          documentId="post-123"
          documentType="post"
          compose={{fieldPath: 'title'}}
        />
      </SDKCommentsProvider>
    </Suspense>
  )
}

To use your own data layer instead of the SDK, see Levels of abstraction.

Contributing

Local development, where new exports go, and the release process are in CONTRIBUTING.md.

FAQs

Package last updated on 30 Oct 2026

Related posts