@sanity/sdk 2.7.0 → 3.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/index.d.ts +228 -239
  2. package/dist/index.js +287 -454
  3. package/dist/index.js.map +1 -1
  4. package/package.json +4 -4
  5. package/src/_exports/index.ts +16 -17
  6. package/src/agent/agentActions.test.ts +60 -16
  7. package/src/agent/agentActions.ts +29 -20
  8. package/src/auth/authMode.test.ts +0 -25
  9. package/src/auth/authMode.ts +3 -6
  10. package/src/auth/authStore.test.ts +129 -66
  11. package/src/auth/authStore.ts +9 -11
  12. package/src/auth/dashboardAuth.ts +2 -2
  13. package/src/auth/getOrganizationVerificationState.test.ts +10 -11
  14. package/src/auth/handleAuthCallback.test.ts +0 -12
  15. package/src/auth/handleAuthCallback.ts +9 -3
  16. package/src/auth/logout.test.ts +0 -6
  17. package/src/auth/refreshStampedToken.test.ts +121 -17
  18. package/src/auth/standaloneAuth.ts +9 -3
  19. package/src/auth/studioAuth.ts +35 -8
  20. package/src/auth/subscribeToStateAndFetchCurrentUser.test.ts +9 -3
  21. package/src/auth/subscribeToStateAndFetchCurrentUser.ts +1 -1
  22. package/src/auth/subscribeToStorageEventsAndSetToken.test.ts +0 -2
  23. package/src/auth/subscribeToStorageEventsAndSetToken.ts +2 -2
  24. package/src/auth/utils.ts +33 -0
  25. package/src/client/clientStore.test.ts +14 -61
  26. package/src/client/clientStore.ts +52 -28
  27. package/src/comlink/controller/actions/destroyController.test.ts +1 -4
  28. package/src/comlink/controller/actions/getOrCreateChannel.test.ts +1 -4
  29. package/src/comlink/controller/actions/getOrCreateController.test.ts +1 -4
  30. package/src/comlink/controller/actions/releaseChannel.test.ts +1 -1
  31. package/src/comlink/controller/comlinkControllerStore.test.ts +1 -4
  32. package/src/comlink/node/actions/getOrCreateNode.test.ts +1 -4
  33. package/src/comlink/node/actions/releaseNode.test.ts +1 -4
  34. package/src/comlink/node/comlinkNodeStore.test.ts +2 -2
  35. package/src/comlink/node/getNodeState.test.ts +1 -1
  36. package/src/config/__tests__/handles.test.ts +12 -18
  37. package/src/config/handles.ts +7 -25
  38. package/src/config/sanityConfig.ts +99 -52
  39. package/src/datasets/datasets.test.ts +2 -2
  40. package/src/datasets/datasets.ts +4 -10
  41. package/src/document/actions.test.ts +33 -4
  42. package/src/document/actions.ts +3 -10
  43. package/src/document/applyDocumentActions.test.ts +17 -18
  44. package/src/document/applyDocumentActions.ts +9 -12
  45. package/src/document/documentStore.test.ts +303 -133
  46. package/src/document/documentStore.ts +70 -61
  47. package/src/document/permissions.test.ts +44 -8
  48. package/src/document/processActions.test.ts +77 -7
  49. package/src/document/reducers.test.ts +35 -3
  50. package/src/document/sharedListener.test.ts +13 -13
  51. package/src/document/sharedListener.ts +8 -3
  52. package/src/favorites/favorites.test.ts +10 -2
  53. package/src/presence/presenceStore.test.ts +34 -9
  54. package/src/presence/presenceStore.ts +29 -13
  55. package/src/preview/previewProjectionUtils.test.ts +192 -0
  56. package/src/preview/previewProjectionUtils.ts +88 -0
  57. package/src/preview/{previewStore.ts → types.ts} +6 -25
  58. package/src/project/project.test.ts +1 -1
  59. package/src/project/project.ts +14 -20
  60. package/src/projection/getProjectionState.test.ts +4 -2
  61. package/src/projection/getProjectionState.ts +2 -21
  62. package/src/projection/projectionQuery.ts +2 -3
  63. package/src/projection/projectionStore.test.ts +3 -3
  64. package/src/projection/resolveProjection.test.ts +2 -1
  65. package/src/projection/resolveProjection.ts +2 -18
  66. package/src/projection/subscribeToStateAndFetchBatches.test.ts +2 -2
  67. package/src/projection/subscribeToStateAndFetchBatches.ts +23 -36
  68. package/src/projection/types.ts +1 -9
  69. package/src/projects/projects.test.ts +1 -1
  70. package/src/query/queryStore.test.ts +86 -28
  71. package/src/query/queryStore.ts +23 -38
  72. package/src/releases/getPerspectiveState.test.ts +14 -13
  73. package/src/releases/getPerspectiveState.ts +6 -6
  74. package/src/releases/releasesStore.test.ts +21 -6
  75. package/src/releases/releasesStore.ts +18 -8
  76. package/src/store/createActionBinder.test.ts +114 -111
  77. package/src/store/createActionBinder.ts +52 -101
  78. package/src/store/createSanityInstance.test.ts +13 -83
  79. package/src/store/createSanityInstance.ts +2 -78
  80. package/src/store/createStateSourceAction.test.ts +2 -2
  81. package/src/store/createStateSourceAction.ts +5 -5
  82. package/src/store/createStoreInstance.test.ts +2 -4
  83. package/src/users/reducers.test.ts +1 -6
  84. package/src/users/reducers.ts +2 -2
  85. package/src/users/types.ts +4 -4
  86. package/src/users/usersStore.test.ts +12 -15
  87. package/src/utils/createFetcherStore.test.ts +1 -1
  88. package/src/utils/logger.test.ts +0 -12
  89. package/src/utils/logger.ts +3 -8
  90. package/src/preview/getPreviewState.test.ts +0 -120
  91. package/src/preview/getPreviewState.ts +0 -91
  92. package/src/preview/previewQuery.test.ts +0 -236
  93. package/src/preview/previewQuery.ts +0 -153
  94. package/src/preview/previewStore.test.ts +0 -36
  95. package/src/preview/resolvePreview.test.ts +0 -47
  96. package/src/preview/resolvePreview.ts +0 -20
  97. package/src/preview/subscribeToStateAndFetchBatches.test.ts +0 -221
  98. package/src/preview/subscribeToStateAndFetchBatches.ts +0 -112
  99. package/src/preview/util.ts +0 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/sdk",
3
- "version": "2.7.0",
3
+ "version": "3.0.0-rc.0",
4
4
  "private": false,
5
5
  "description": "Sanity SDK",
6
6
  "keywords": [
@@ -49,11 +49,11 @@
49
49
  "@sanity/diff-match-patch": "^3.2.0",
50
50
  "@sanity/diff-patch": "^6.0.0",
51
51
  "@sanity/id-utils": "^1.0.0",
52
+ "@sanity/image-url": "^2.0.3",
52
53
  "@sanity/json-match": "^1.0.5",
53
54
  "@sanity/message-protocol": "^0.18.0",
54
55
  "@sanity/mutate": "^0.12.4",
55
56
  "@sanity/types": "^5.2.0",
56
- "groq": "3.88.1-typegen-experimental.0",
57
57
  "groq-js": "^1.19.0",
58
58
  "lodash-es": "^4.17.21",
59
59
  "reselect": "^5.1.1",
@@ -75,8 +75,8 @@
75
75
  "@repo/config-eslint": "0.0.0",
76
76
  "@repo/config-test": "0.0.1",
77
77
  "@repo/package.bundle": "3.82.0",
78
- "@repo/package.config": "0.0.1",
79
- "@repo/tsconfig": "0.0.1"
78
+ "@repo/tsconfig": "0.0.1",
79
+ "@repo/package.config": "0.0.1"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=20.19"
@@ -12,6 +12,7 @@ export type {
12
12
  AgentPatchResult,
13
13
  AgentPromptOptions,
14
14
  AgentPromptResult,
15
+ AgentResourceOptions,
15
16
  AgentTransformOptions,
16
17
  AgentTransformResult,
17
18
  AgentTranslateOptions,
@@ -71,10 +72,9 @@ export {
71
72
  } from '../comlink/types'
72
73
  export {type AuthConfig, type AuthProvider} from '../config/authConfig'
73
74
  export {
74
- createDatasetHandle,
75
75
  createDocumentHandle,
76
76
  createDocumentTypeHandle,
77
- createProjectHandle,
77
+ createResourceHandle,
78
78
  } from '../config/handles'
79
79
  export {
80
80
  configureLogging,
@@ -86,19 +86,19 @@ export {
86
86
  type LogNamespace,
87
87
  } from '../config/loggingConfig'
88
88
  export {
89
- type CanvasSource,
90
- type DatasetHandle,
91
- type DatasetSource,
89
+ type CanvasResource,
90
+ type DatasetResource,
91
+ DEFAULT_RESOURCE_NAME,
92
92
  type DocumentHandle,
93
- type DocumentSource,
93
+ type DocumentResource,
94
94
  type DocumentTypeHandle,
95
- isCanvasSource,
96
- isDatasetSource,
97
- isMediaLibrarySource,
98
- type MediaLibrarySource,
95
+ isCanvasResource,
96
+ isDatasetResource,
97
+ isMediaLibraryResource,
98
+ type MediaLibraryResource,
99
99
  type PerspectiveHandle,
100
- type ProjectHandle,
101
100
  type ReleasePerspective,
101
+ type ResourceHandle,
102
102
  type SanityConfig,
103
103
  type StudioConfig,
104
104
  type TokenSource,
@@ -145,7 +145,6 @@ export {
145
145
  type TransactionAcceptedEvent,
146
146
  type TransactionRevertedEvent,
147
147
  } from '../document/events'
148
- export {type JsonMatch} from '../document/patchOperations'
149
148
  export {type DocumentPermissionsResult, type PermissionDeniedReason} from '../document/permissions'
150
149
  export type {FavoriteStatusResponse} from '../favorites/favorites'
151
150
  export {getFavoritesState, resolveFavoritesState} from '../favorites/favorites'
@@ -158,14 +157,14 @@ export type {
158
157
  TransportEvent,
159
158
  UserPresence,
160
159
  } from '../presence/types'
161
- export {getPreviewState, type GetPreviewStateOptions} from '../preview/getPreviewState'
162
- export type {PreviewStoreState, PreviewValue, ValuePending} from '../preview/previewStore'
163
- export {resolvePreview, type ResolvePreviewOptions} from '../preview/resolvePreview'
160
+ export {PREVIEW_PROJECTION} from '../preview/previewConstants'
161
+ export {transformProjectionToPreview} from '../preview/previewProjectionUtils'
162
+ export type {PreviewMedia, PreviewQueryResult, PreviewValue, ValuePending} from '../preview/types'
164
163
  export {type OrgVerificationResult} from '../project/organizationVerification'
165
- export {getProjectState, resolveProject} from '../project/project'
164
+ export {getProjectState, type ProjectHandle, resolveProject} from '../project/project'
166
165
  export {getProjectionState} from '../projection/getProjectionState'
167
166
  export {resolveProjection} from '../projection/resolveProjection'
168
- export {type ProjectionValuePending, type ValidProjection} from '../projection/types'
167
+ export {type ProjectionValuePending} from '../projection/types'
169
168
  export {getProjectsState, resolveProjects} from '../projects/projects'
170
169
  export {
171
170
  getQueryKey,
@@ -11,13 +11,16 @@ import {
11
11
  } from './agentActions'
12
12
 
13
13
  let mockClient: any
14
+ const mockGetClientState = vi.fn()
14
15
 
15
16
  vi.mock('../client/clientStore', () => {
16
17
  return {
17
- getClientState: () => ({observable: of(mockClient)}),
18
+ getClientState: (...args: unknown[]) => mockGetClientState(...args),
18
19
  }
19
20
  })
20
21
 
22
+ const testResource = {projectId: 'p', dataset: 'd'}
23
+
21
24
  describe('agent actions', () => {
22
25
  beforeEach(() => {
23
26
  mockClient = {
@@ -37,45 +40,86 @@ describe('agent actions', () => {
37
40
  },
38
41
  },
39
42
  }
43
+ mockGetClientState.mockReturnValue({observable: of(mockClient)})
40
44
  })
41
45
 
42
- it('agentGenerate returns observable from client', async () => {
46
+ it('agentGenerate passes resource to getClientState and strips it from agent options', async () => {
43
47
  mockClient.observable.agent.action.generate.mockReturnValue(of('gen'))
44
- const instance = {config: {projectId: 'p', dataset: 'd'}} as any
45
- const value = await firstValueFrom(agentGenerate(instance, {foo: 'bar'} as any))
48
+ const instance = {config: {}} as any
49
+ const value = await firstValueFrom(
50
+ agentGenerate(instance, {foo: 'bar', resource: testResource} as any),
51
+ )
46
52
  expect(value).toBe('gen')
53
+ expect(mockGetClientState).toHaveBeenCalledWith(instance, {
54
+ apiVersion: 'vX',
55
+ resource: testResource,
56
+ })
47
57
  expect(mockClient.observable.agent.action.generate).toHaveBeenCalledWith({foo: 'bar'})
48
58
  })
49
59
 
50
- it('agentTransform returns observable from client', async () => {
60
+ it('agentTransform passes resource to getClientState and strips it from agent options', async () => {
51
61
  mockClient.observable.agent.action.transform.mockReturnValue(of('xform'))
52
- const instance = {config: {projectId: 'p', dataset: 'd'}} as any
53
- const value = await firstValueFrom(agentTransform(instance, {a: 1} as any))
62
+ const instance = {config: {}} as any
63
+ const value = await firstValueFrom(
64
+ agentTransform(instance, {a: 1, resource: testResource} as any),
65
+ )
54
66
  expect(value).toBe('xform')
67
+ expect(mockGetClientState).toHaveBeenCalledWith(instance, {
68
+ apiVersion: 'vX',
69
+ resource: testResource,
70
+ })
55
71
  expect(mockClient.observable.agent.action.transform).toHaveBeenCalledWith({a: 1})
56
72
  })
57
73
 
58
- it('agentTranslate returns observable from client', async () => {
74
+ it('agentTranslate passes resource to getClientState and strips it from agent options', async () => {
59
75
  mockClient.observable.agent.action.translate.mockReturnValue(of('xlate'))
60
- const instance = {config: {projectId: 'p', dataset: 'd'}} as any
61
- const value = await firstValueFrom(agentTranslate(instance, {b: 2} as any))
76
+ const instance = {config: {}} as any
77
+ const value = await firstValueFrom(
78
+ agentTranslate(instance, {b: 2, resource: testResource} as any),
79
+ )
62
80
  expect(value).toBe('xlate')
81
+ expect(mockGetClientState).toHaveBeenCalledWith(instance, {
82
+ apiVersion: 'vX',
83
+ resource: testResource,
84
+ })
63
85
  expect(mockClient.observable.agent.action.translate).toHaveBeenCalledWith({b: 2})
64
86
  })
65
87
 
66
- it('agentPrompt wraps promise into observable', async () => {
88
+ it('agentPrompt passes resource to getClientState and strips it from agent options', async () => {
67
89
  mockClient.agent.action.prompt.mockResolvedValue('prompted')
68
- const instance = {config: {projectId: 'p', dataset: 'd'}} as any
69
- const value = await firstValueFrom(agentPrompt(instance, {p: true} as any))
90
+ const instance = {config: {}} as any
91
+ const value = await firstValueFrom(
92
+ agentPrompt(instance, {p: true, resource: testResource} as any),
93
+ )
70
94
  expect(value).toBe('prompted')
95
+ expect(mockGetClientState).toHaveBeenCalledWith(instance, {
96
+ apiVersion: 'vX',
97
+ resource: testResource,
98
+ })
71
99
  expect(mockClient.agent.action.prompt).toHaveBeenCalledWith({p: true})
72
100
  })
73
101
 
74
- it('agentPatch wraps promise into observable', async () => {
102
+ it('agentPatch passes resource to getClientState and strips it from agent options', async () => {
75
103
  mockClient.agent.action.patch.mockResolvedValue('patched')
76
- const instance = {config: {projectId: 'p', dataset: 'd'}} as any
77
- const value = await firstValueFrom(agentPatch(instance, {q: false} as any))
104
+ const instance = {config: {}} as any
105
+ const value = await firstValueFrom(
106
+ agentPatch(instance, {q: false, resource: testResource} as any),
107
+ )
78
108
  expect(value).toBe('patched')
109
+ expect(mockGetClientState).toHaveBeenCalledWith(instance, {
110
+ apiVersion: 'vX',
111
+ resource: testResource,
112
+ })
79
113
  expect(mockClient.agent.action.patch).toHaveBeenCalledWith({q: false})
80
114
  })
115
+
116
+ it('works without an explicit resource (falls back via getClientState)', async () => {
117
+ mockClient.observable.agent.action.generate.mockReturnValue(of('gen'))
118
+ const instance = {config: {}} as any
119
+ await firstValueFrom(agentGenerate(instance, {foo: 'bar'} as any))
120
+ expect(mockGetClientState).toHaveBeenCalledWith(instance, {
121
+ apiVersion: 'vX',
122
+ resource: undefined,
123
+ })
124
+ })
81
125
  })
@@ -2,10 +2,19 @@ import {type SanityClient} from '@sanity/client'
2
2
  import {from, Observable, switchMap} from 'rxjs'
3
3
 
4
4
  import {getClientState} from '../client/clientStore'
5
+ import {type DocumentResource} from '../config/sanityConfig'
5
6
  import {type SanityInstance} from '../store/createSanityInstance'
6
7
 
7
8
  const API_VERSION = 'vX'
8
9
 
10
+ /**
11
+ * Options that all agent actions accept for targeting a specific resource.
12
+ * @alpha
13
+ */
14
+ export interface AgentResourceOptions {
15
+ resource: DocumentResource
16
+ }
17
+
9
18
  /** @alpha */
10
19
  export type AgentGenerateOptions = Parameters<
11
20
  SanityClient['observable']['agent']['action']['generate']
@@ -57,13 +66,13 @@ export type AgentPatchResult = Awaited<ReturnType<SanityClient['agent']['action'
57
66
  */
58
67
  export function agentGenerate(
59
68
  instance: SanityInstance,
60
- options: AgentGenerateOptions,
69
+ options: AgentGenerateOptions & AgentResourceOptions,
61
70
  ): AgentGenerateResult {
71
+ const {resource, ...agentOptions} = options
62
72
  return getClientState(instance, {
63
73
  apiVersion: API_VERSION,
64
- projectId: instance.config.projectId,
65
- dataset: instance.config.dataset,
66
- }).observable.pipe(switchMap((client) => client.observable.agent.action.generate(options)))
74
+ resource,
75
+ }).observable.pipe(switchMap((client) => client.observable.agent.action.generate(agentOptions)))
67
76
  }
68
77
 
69
78
  /**
@@ -75,13 +84,13 @@ export function agentGenerate(
75
84
  */
76
85
  export function agentTransform(
77
86
  instance: SanityInstance,
78
- options: AgentTransformOptions,
87
+ options: AgentTransformOptions & AgentResourceOptions,
79
88
  ): AgentTransformResult {
89
+ const {resource, ...agentOptions} = options
80
90
  return getClientState(instance, {
81
91
  apiVersion: API_VERSION,
82
- projectId: instance.config.projectId,
83
- dataset: instance.config.dataset,
84
- }).observable.pipe(switchMap((client) => client.observable.agent.action.transform(options)))
92
+ resource,
93
+ }).observable.pipe(switchMap((client) => client.observable.agent.action.transform(agentOptions)))
85
94
  }
86
95
 
87
96
  /**
@@ -93,13 +102,13 @@ export function agentTransform(
93
102
  */
94
103
  export function agentTranslate(
95
104
  instance: SanityInstance,
96
- options: AgentTranslateOptions,
105
+ options: AgentTranslateOptions & AgentResourceOptions,
97
106
  ): AgentTranslateResult {
107
+ const {resource, ...agentOptions} = options
98
108
  return getClientState(instance, {
99
109
  apiVersion: API_VERSION,
100
- projectId: instance.config.projectId,
101
- dataset: instance.config.dataset,
102
- }).observable.pipe(switchMap((client) => client.observable.agent.action.translate(options)))
110
+ resource,
111
+ }).observable.pipe(switchMap((client) => client.observable.agent.action.translate(agentOptions)))
103
112
  }
104
113
 
105
114
  /**
@@ -111,13 +120,13 @@ export function agentTranslate(
111
120
  */
112
121
  export function agentPrompt(
113
122
  instance: SanityInstance,
114
- options: AgentPromptOptions,
123
+ options: AgentPromptOptions & AgentResourceOptions,
115
124
  ): Observable<AgentPromptResult> {
125
+ const {resource, ...agentOptions} = options
116
126
  return getClientState(instance, {
117
127
  apiVersion: API_VERSION,
118
- projectId: instance.config.projectId,
119
- dataset: instance.config.dataset,
120
- }).observable.pipe(switchMap((client) => from(client.agent.action.prompt(options))))
128
+ resource,
129
+ }).observable.pipe(switchMap((client) => from(client.agent.action.prompt(agentOptions))))
121
130
  }
122
131
 
123
132
  /**
@@ -129,11 +138,11 @@ export function agentPrompt(
129
138
  */
130
139
  export function agentPatch(
131
140
  instance: SanityInstance,
132
- options: AgentPatchOptions,
141
+ options: AgentPatchOptions & AgentResourceOptions,
133
142
  ): Observable<AgentPatchResult> {
143
+ const {resource, ...agentOptions} = options
134
144
  return getClientState(instance, {
135
145
  apiVersion: API_VERSION,
136
- projectId: instance.config.projectId,
137
- dataset: instance.config.dataset,
138
- }).observable.pipe(switchMap((client) => from(client.agent.action.patch(options))))
146
+ resource,
147
+ }).observable.pipe(switchMap((client) => from(client.agent.action.patch(agentOptions))))
139
148
  }
@@ -9,11 +9,6 @@ describe('resolveAuthMode', () => {
9
9
  expect(resolveAuthMode(config, 'https://example.com')).toBe('studio')
10
10
  })
11
11
 
12
- it('returns "studio" when deprecated studioMode.enabled is true', () => {
13
- const config: SanityConfig = {studioMode: {enabled: true}}
14
- expect(resolveAuthMode(config, 'https://example.com')).toBe('studio')
15
- })
16
-
17
12
  it('returns "dashboard" when _context URL param has a non-empty JSON object', () => {
18
13
  const context = encodeURIComponent(JSON.stringify({orgId: '123'}))
19
14
  const href = `https://example.com?_context=${context}`
@@ -23,14 +18,6 @@ describe('resolveAuthMode', () => {
23
18
  it('returns "standalone" by default', () => {
24
19
  expect(resolveAuthMode({}, 'https://example.com')).toBe('standalone')
25
20
  })
26
-
27
- it('prefers studio config over studioMode', () => {
28
- const config: SanityConfig = {
29
- studio: {},
30
- studioMode: {enabled: true},
31
- }
32
- expect(resolveAuthMode(config, 'https://example.com')).toBe('studio')
33
- })
34
21
  })
35
22
 
36
23
  describe('isStudioConfig', () => {
@@ -38,19 +25,7 @@ describe('isStudioConfig', () => {
38
25
  expect(isStudioConfig({studio: {}})).toBe(true)
39
26
  })
40
27
 
41
- it('returns true when deprecated studioMode.enabled is true', () => {
42
- expect(isStudioConfig({studioMode: {enabled: true}})).toBe(true)
43
- })
44
-
45
- it('returns false when studioMode.enabled is false', () => {
46
- expect(isStudioConfig({studioMode: {enabled: false}})).toBe(false)
47
- })
48
-
49
28
  it('returns false for empty config', () => {
50
29
  expect(isStudioConfig({})).toBe(false)
51
30
  })
52
-
53
- it('returns true when both studio and studioMode are present', () => {
54
- expect(isStudioConfig({studio: {}, studioMode: {enabled: true}})).toBe(true)
55
- })
56
31
  })
@@ -20,9 +20,8 @@ type AuthMode = 'studio' | 'dashboard' | 'standalone'
20
20
  *
21
21
  * Priority:
22
22
  * 1. `studio` config provided → `'studio'`
23
- * 2. `studioMode.enabled` in config (deprecated) → `'studio'`
24
- * 3. Dashboard context detected (`_context` URL param with content) → `'dashboard'`
25
- * 4. Otherwise → `'standalone'`
23
+ * 2. Dashboard context detected (`_context` URL param with content) → `'dashboard'`
24
+ * 3. Otherwise → `'standalone'`
26
25
  *
27
26
  * @internal
28
27
  */
@@ -34,13 +33,11 @@ export function resolveAuthMode(config: SanityConfig, locationHref: string): Aut
34
33
 
35
34
  /**
36
35
  * Returns `true` when the config indicates the SDK is running inside a Studio.
37
- * Checks the new `studio` field first, then falls back to the deprecated
38
- * `studioMode.enabled` for backwards compatibility.
39
36
  *
40
37
  * @internal
41
38
  */
42
39
  export function isStudioConfig(config: SanityConfig): boolean {
43
- return !!config.studio || !!config.studioMode?.enabled
40
+ return !!config.studio
44
41
  }
45
42
 
46
43
  /**