Advanced Sanity integration for Nuxt.js. Based on the official @nuxtjs/sanity module.
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 ✨
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"
}
}
};
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