Quick Start


v1 of this module works with Nuxt 3 and Nuxt Bridge. If you are looking for the old docs, you can find them here.

Setup

  1. Install Sanity integration
    Yarn
    yarn add @nuxtjs/sanity
    
    NPM
    npm install @nuxtjs/sanity --save
    
  2. Enable the module in your Nuxt configuration
    nuxt.config.ts
    export default defineNuxtConfig({
      modules: ['@nuxtjs/sanity']
    })
    
  3. Add Sanity configuration
    This module will look for a sanity.json file in your project root directory. You can copy this over from your CMS - and you're fully configured! 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.
  4. You're good to go!
    Check out how to use Sanity.