Skip to content

mariuslundgard/sanity-template-nextjs

Repository files navigation

sanity-template-nextjs

This is a template for new projects using Next.js with embedded Sanity integration and Sanity Studio on the /studio route.

NOTE: This template intentionally does NOT use Next.js’s experimental appDir feature since there are known issues with this. I’ll wait until their appDir feature is stable.

Deploy with Vercel

Features

  • Live previews using next-sanity.
  • Customized Sanity Desk Tool.
  • Just TypeScript.
  • Eslint configuration.
  • Environment variables.
  • Tailwind.

Getting started

Initialize project

# Install dependencies
pnpm install

# Create a Sanity project ID and dataset and write to `.env.local`
pnpm exec sanity init --env .env.local

# Start development server
pnpm dev