Adds refreshes data on tab focus and current user attributes
Published: November 25, 2026
Dashboard view hooks and types, which are in beta, return a new shape, so apps that use them need code changes when they upgrade. Apps can now read the signed-in user's attributes, and, in beta, cached data refreshes when someone returns to the tab.
New features
Refresh data when someone returns to the tab
When someone comes back to an app's tab, cached data the app shows, such as projects, applications and preferences, is fetched again if it's more than 30 seconds old. Changes made elsewhere show without a reload. This option is in beta, on by default, and can add API requests. If more than one SDK instance on the page shows the same data, the instance that started showing it last decides. To turn it off, set refetchOnWindowFocus to false in the app's config:
import type {SanityConfig} from '@sanity/sdk'
export const config: SanityConfig = {
projectId: '<your-project-id>',
dataset: 'production',
refetchOnWindowFocus: false,
}Read the current user's attributes
Set auth.includeUserAttributes to true in your app config and useCurrentUser returns the signed-in user's attributes as attributes. The attributes belong to the organization from the Dashboard context, or to the organizationId in your config. attributes is missing when the user isn't a member of that organization or the token doesn't cover it.
import type {SanityConfig} from '@sanity/sdk'
import {useCurrentUser} from '@sanity/sdk-react'
export const config: SanityConfig = {
projectId: '<your-project-id>',
dataset: 'production',
auth: {includeUserAttributes: true},
}
export function Team() {
const user = useCurrentUser()
const team = user?.attributes?.find((attribute) => attribute.key === 'team')
return <span>{team?.value}</span>
}Improvements
- Preferences:
useUserPreferenceanduseUserPreferenceListaccept arefetchIntervaloption. Pass a number of milliseconds to change the polling interval, orfalseto stop polling. Polling stays at 60 seconds by default. TheuserPreferenceanduserPreferenceListfetchers in@sanity/sdkaccept it too. - Installations: an installation's
applicationhasupdatedAt, when the installed app last changed. Passorganizationinincludeto also getapplication.organization.logoUrl, the logo of the organization that publishes the app. - Projects: projects from the project and projects APIs include
logoUrl, the CDN URL of the project's logo, ornullwhen it has none. - Documents: the first document change is sent to the API without the one-second wait. Repeated edits are still batched, and pending edits are sent before a publish, in the order you made them.
Fixes
- Cached data: hundreds of components waiting on the same cached data, like a row each in a long table, no longer report "Maximum call stack size exceeded" when the data arrives. The data is cleaned up once the components unmount.