Getting Started

Installation

Setup

  1. Install Sanity integration
    npx nuxi@latest module add sanity
    
  2. Enable the module in your Nuxt configuration
nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/sanity']
})
  1. Add Sanity configuration

This module will look for a ~~/cms/sanity.config.ts file relative to your project's root directory. Alternatively, you can pass in an object in your Nuxt config with key details.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/sanity'],
  sanity: {
    projectId: 'myProject'
  }
})
You can find more about configuring @nuxtjs/sanityhere.
  1. You're good to go!

Check out how to use Sanity.