Sanity React App SDK v2.7.0: Zero-config Studio integration and perspective-aware projections

This release introduces zero-config usage of the SDK inside Sanity Studio, perspective-aware projections, and improved Agent Action hook documentation.

Zero-config Studio integration

SanityApp can now run inside Sanity Studio without any manual configuration. The SDK automatically reads the active workspace's project ID, dataset, and authentication state through a new SDKStudioContext.

Before (v2.6): Studio tools required explicit configuration, even when running inside Studio.

import {SanityApp} from '@sanity/sdk-react'

const config = {
projectId: 'my-project-id',
dataset: 'production',
}

function MyStudioTool() {
return (
<SanityApp config={config} fallback={ Loading… }>
<MyComponent />
</SanityApp>
)
}

After (v2.7): No config is needed inside Studio. The SDK derives everything from the workspace.

import {SanityApp} from '@sanity/sdk-react'

function MyStudioTool() {
return (
<SanityApp fallback={ Loading… }>
<MyComponent />
</SanityApp>
)
}

Standalone apps outside Studio still pass a config prop. When both are present, the explicit config takes precedence.

Authentication is also automatic. The SDK subscribes to the Studio's token source, so Studio remains the single authority for auth and token refresh. For older Studio versions without a reactive token source, the SDK falls back to localStorage and cookie-based discovery.

Migrating from studioMode

studioMode is deprecated. Replace it with the new studio config property:

const config = {
projectId: 'my-project',
dataset: 'production',
- studioMode: { enabled: true },
+ studio: {},
}

Perspective-aware projections

useDocumentProjection now respects the active perspective (for example, 'drafts' or a release perspective) and document source. Previously, projections always queried with a 'raw' perspective and applied a manual draft overlay. Projections now follow the configured perspective directly, which means references (such as author->name) resolve correctly for drafts and releases.No code changes are required. Existing usage works the same way.

🐛 Notable bug fixes and improvements

Corrected useAgentPatch TSDoc examples to match the PatchDocument API.

All Agent Action hooks now include inline TSDoc examples with usage patterns.

Updated @sanity/client dependency.