Skip to content

cristoferespindola/hello-sanity-and-next

Repository files navigation

Sanity + Next.js + Vercel example

A bare bones example of a Vercel-deployable project with a Next.js frontend and a Sanity Studio on /studio

Getting started

  1. Clone repo
    git clone https://github.com/sanity-io/sanity-nextjs-examle
    
  2. Install dependencies
    yarn install
    
  3. Setup Sanity
    cd studio && sanity init
    
    This will prompt you if you want to reconfigure the project. Answer yes and follow instructions to create a new project.
  4. Setup Vercel deployment
    vercel
    
    When asked about build settings, make sure to use yarn run dev as the development command

Notes

In development (using yarn run dev)

In production (using vercel)

  • The Next.js application will be available on https://<your-domain>
  • The Sanity Studio will be accessible on https://<your-domain>/studio