ConstA stable callback. When called with a single ReleaseAction or an
array of ReleaseActions, it returns a promise that resolves to an
ActionsResult.
import {
createRelease,
scheduleRelease,
useApplyReleaseActions,
type ReleaseHandle,
} from '@sanity/sdk-react'
function ScheduleReleaseButton({release}: {release: ReleaseHandle}) {
const applyRelease = useApplyReleaseActions()
const handleSchedule = () =>
applyRelease([
createRelease(release, {title: 'Summer drop', releaseType: 'asap'}),
scheduleRelease(release, '2026-06-01T00:00:00Z'),
])
return <button onClick={handleSchedule}>Schedule</button>
}
import {publishRelease, useApplyReleaseActions} from '@sanity/sdk-react'
function PublishButton({releaseId}: {releaseId: string}) {
const applyRelease = useApplyReleaseActions()
return (
<button onClick={() => applyRelease(publishRelease({releaseId}))}>
Publish all documents in the release
</button>
)
}
Provides a stable callback function for applying one or more release actions.
This hook wraps the core
applyDocumentActionsfunctionality from@sanity/sdk, integrating it with the React component lifecycle and SanityInstance. It accepts release-lifecycle actions generated by createRelease, editRelease, publishRelease, scheduleRelease, unscheduleRelease, archiveRelease, unarchiveRelease, and deleteRelease.Note that actions submitted via this hook will cascade to the documents in the release. For example, if you create a release and then publish it, the documents in the release will be published. If you delete a published release, the version documents will be deleted.
Features:
ReleaseActionobjects.Release actions cannot be combined with
liveEditdocument actions in the same transaction. Submit them as separate transactions if you need both.