Sanity React App SDK v2.9.0: New useWindowTitle hook and bugfixes

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 Content
}

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 onSubscribe sometimes skipped legitimate first state changes in createStateSourceAction.

Prevented unnecessary token refreshes by correctly initializing lastTokenRefresh for 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 useEditDocument and useApplyDocumentActions created drafts instead of working against a content release version. Use the perspective option 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 (
editArticle(prev => ({...prev, title: 'Updated for release'}))}>
Edit in release

)
}