New useWindowTitle hook and bugfixes
Published: April 22, 2026
This release introduces a new useWindowTitle hook, opt-in dev-mode telemetry, and several reliability improvements across authentication and document handling.
New useWindowTitle hook
Use the new useWindowTitle hook to manage browser tab titles from your components. Pass it a string, and it sets the document title for the active tab.
import { useWindowTitle } from '@sanity/sdk-react'
function MyComponent() {
useWindowTitle('My Custom Title')
return <div>Content</div>
}View the reference documentation for more details.
Opt-in dev-mode telemetry
The SDK now supports consent-gated telemetry in development mode. Telemetry only activates after you explicitly opt in, is fully tree-shaken from production builds, and never affects SDK functionality. No queries, document IDs, or field names are collected. You can configure your telemetry settings in manage.
🐛 Notable bugfixes and improvements
- Fixed Studio mode cookie authentication when the token source emits
null. - Fixed an issue where
onSubscribesometimes skipped legitimate first state changes increateStateSourceAction. - Prevented unnecessary token refreshes by correctly initializing
lastTokenRefreshfor stamped tokens. - Prevented cleanup timers from keeping Node.js processes alive.
- Live-edit documents now use the mutations endpoint, so edits no longer create drafts.
- Fixed an issue where
useEditDocumentanduseApplyDocumentActionscreated drafts instead of working against a content release version. Use theperspectiveoption to target a specific release:
import { useEditDocument } from '@sanity/sdk-react'
function EditArticleInRelease({documentId}: {documentId: string}) {
// Use the document's plain ID, not `versions.<releaseName>.<id>`.
// Add the document to a release first with `createDocument` if needed.
const editArticle = useEditDocument({
documentId,
documentType: 'article',
perspective: {releaseName: 'rxV176dy'},
})
return (
<button onClick={() => editArticle(prev => ({...prev, title: 'Updated for release'}))}>
Edit in release
</button>
)
}