This is a demo of how to add a simple comment section to blog post using Next.js, Sanity.io, and Vercel.
You'll need to create a .env.local
file to store a few environment variables that Next will use to pull data from the Sanity API.
SANITY_API_TOKEN="API-TOKEN-FROM MANAGE.SANITY.IO"
Once those env variables are ready, you can run the following commands to get Next's development server up and running:
npm install
npm run dev
The blog will be running at http://localhost:3000
To run the Sanity Studio locally, you'll need to run the following commands:
First install the Sanity CLI: npm install -g @sanity/cli
.
# From the project root
cd studio
sanity start
The Studio will be running at http://localhost:3333