-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsanity.config.ts
More file actions
34 lines (26 loc) · 1.09 KB
/
sanity.config.ts
File metadata and controls
34 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use client'
import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import { visionTool } from '@sanity/vision'
import { schemaTypes } from './sanity/schemas'
import { notionImportPlugin } from './sanity/plugins/notionImportTool'
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID || process.env.SANITY_STUDIO_PROJECT_ID
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET || process.env.SANITY_STUDIO_DATASET
const apiVersion = process.env.NEXT_PUBLIC_SANITY_API_VERSION || process.env.SANITY_STUDIO_API_VERSION || '2024-01-18'
if (!projectId) {
throw new Error('Missing NEXT_PUBLIC_SANITY_PROJECT_ID or SANITY_STUDIO_PROJECT_ID environment variable')
}
if (!dataset) {
throw new Error('Missing NEXT_PUBLIC_SANITY_DATASET or SANITY_STUDIO_DATASET environment variable')
}
export default defineConfig({
name: 'monashcoding-studio',
title: 'Monash Association of Coding',
projectId,
dataset,
basePath: '/studio',
plugins: [structureTool(), visionTool({ defaultApiVersion: apiVersion }), notionImportPlugin()],
schema: {
types: schemaTypes,
},
})