Thanks to visit codestin.com
Credit goes to github.com

Skip to content

devite-io/nuxt-sanity

Repository files navigation

Nuxt Sanity Integration

npm version

Advanced Sanity integration for Nuxt.js. Based on the official @nuxtjs/sanity module.

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add @devite/nuxt-sanity

That's it! You can now use Sanity with your Nuxt app ✨

Configuration

Further configuration can be done in the nuxt.config.ts file:

export default {
  modules: [
    '@devite/nuxt-sanity',
    "@nuxt/image"
  ],
  sanity: {
    projectId: 'YOUR_PROJECT_ID',
    dataset: 'YOUR_DATASET',
    ...
  },
  runtimeConfig: {
    public: {
      // Required for SanityPage component to set a correct "canonical" url
      baseUrl: "https://www.example.com"
    }
  }
};

Contribution

Local development
# Install dependencies
pnpm install

# Generate type stubs
pnpm dev:prepare

# Generate module types and build the module
pnpm prepack

# Develop with the playground
pnpm dev

# Build the playground
pnpm dev:build

# Run ESLint
pnpm lint

# Run Vitest
pnpm test
pnpm test:watch

# Release new version
pnpm release