npm @sanity/client 7.2.0
v7.2.0

latest releases: 7.11.0-cors-check.1, 7.11.0-cors-check.0, 7.11.0-live-cors...
3 months ago

7.2.0 (2025-05-09)

Features

Content Release and Document Version operations (#1067) (9b80bd8)

The client now has complete abstractions and types for all Content Lake release and version actions.

These are available to be used directly interfacing with the server action:

client.action(
  {
    actionType: 'sanity.action.document.version.create',
    publishedId: 'bike-123',
    document: {
      _id: 'versions.new-bike-release.bike-123'
      _type: 'bike'
    }
  }
)

Or additionally through method abstractions which provide more unified concepts such as releaseId and publishedId, in addition to client side guards on mismatching IDs:

client.createVersion(
  {
    publishedId: 'bike-123',
    releaseId: 'new-bike-release',
    document: {
      _type: 'bike'
    }
  }
)

Important

Deprecation notice of some document server actions
The discard and replaceDraft actions now have deprecation notices in the client, to reflect updates on the underlying Content Lake API.

discard is superseded by discardVersion and replaceDraft by replaceVersion

Don't miss a new client release

NewReleases is sending notifications on new releases.