Typed queries, preference hooks, and dashboard pagination

Published: November 16, 2026

v3.13.0

SDK 3.13.0 adds typed GROQ query results, beta hooks for user preferences, and pagination support for dashboard hooks. It also fixes several reliability issues with authentication, cached reads, and pending changes.

Typed GROQ queries

useQuery, getQueryState, and resolveQuery now infer result and parameter types from queries imported through @sanity-labs/groq-content-mapper. This feature is experimental. It needs TypeScript 7.1 or later, type-checking with tsc --noEmit --runExternalCode, and a schema.json from npx sanity schema extract. Setup also needs a contentMappers entry in your tsconfig and the @sanity-labs/groq-content-mapper/vite plugin in sanity.cli.ts.

User preference hooks (beta)

New hooks let apps read and update per-user, per-project, and shared preferences. Keys come from a fixed set that Sanity owns (context.*, dashboard.*, manage.*, and studio.*), so apps can't define their own keys.

Preferences can be scoped to a project, an organization, or a user. With shared: true, a hook reads or changes the value that everyone in the project or organization shares, for keys that have a shared value. resourceType picks the project or organization. Each preference also reports isDefault and canEdit flags.

Requests for a project's preferences go to the project's API host (<projectId>.api.sanity.io). Set useProjectHostname: false to use the global API host instead. Organization and user preferences use the global host.

Paginated dashboard hooks

useApplications and useInstallations now support pagination through a loadMore function and a hasMore flag. useUsers already had these, and now also returns an error field, so a failed loadMore keeps the users already shown. The older cursor option on useApplications and useInstallations, and the userId option on useUsers, are deprecated, along with getUsersState, resolveUsers, and loadMoreUsers. Those three functions will be removed in the next major release.

Dashboard panel and tile hooks

New and updated hooks in @sanity/sdk-react/dashboard work with dashboard panels, tiles, and applications.

šŸ› Notable bugfixes and improvements

  • useCurrentUser no longer briefly returns null after an OAuth token refresh.
  • Pending preference and favorite changes stay visible while other changes are resolving, fixing favorites that appeared to disappear when starred in quick succession.
  • Preference reads made together are now batched into a single request per project, organization, or user, up to 100 keys at a time.
  • Changes to preference lists, applications, and document favorites are now sent in the order you made them.
  • Cached reads that failed with a 401 error retry automatically once a new token is available. Reads that fail with a network error or a 5xx response retry with backoff.
  • A cached read that previously failed now sends a fresh request instead of returning the old error.
  • Read failures that aren't network-related now show immediately instead of retrying indefinitely.
Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme