# New useWindowTitle hook and bugfixes

**Version:** v2.9.0

**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.

**App.tsx**

```tsx
import { useWindowTitle } from '@sanity/sdk-react'

function MyComponent() {
  useWindowTitle('My Custom Title')
  return <div>Content</div>
}

```

[View the reference documentation](https://reference.sanity.io/_sanity/sdk-react/exports/useWindowTitle/) 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](https://www.sanity.io/manage/personal/account-settings).

## 🐛 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](https://www.sanity.io/docs/user-guides/content-releases). Use the `perspective` option to target a specific release:

**App.tsx**

```tsx
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>
  )
}

```

