nuxt-jsonld is a specialized Nuxt.js module designed to streamline the integration and management of JSON-LD (Linked Data) within Vue components, primarily for SEO purposes. Currently at version 2.2.1, it provides a developer-friendly API for embedding structured data directly into Nuxt 3 applications. The module maintains an active release cadence, with the latest update in June 2025, focusing on bug fixes and compatibility. Key differentiators include its `useJsonld` composable for Composition API, enabling both static and reactive JSON-LD generation, as well as support for the Options API. It addresses the complexities of server-side rendering (SSR) and static site generation (SSG) for structured data, ensuring proper SEO indexing, unlike manual `useHead` implementations that might require more boilerplate and careful handling of reactivity and deduplication. It also provides explicit handling for Nuxt 2 users via its v1 documentation.
npm install nuxt-jsonldVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up `nuxt-jsonld` in `nuxt.config.ts` and use the `useJsonld` composable within a Vue component to define both static and reactive JSON-LD structured data.
Refer to the v2 documentation for updated usage with `useJsonld` in `<script setup>` or the Options API `jsonld()` method. Ensure `nuxt-jsonld` is added to the `modules` array in `nuxt.config.ts`.
Update any manual `script` tag injections or similar patterns to use `innerHTML` instead of `children` for embedding JSON-LD content.
If encountering type-related issues after upgrading, ensure your TypeScript configuration aligns with `vue` module augmentations. You might need to adjust or remove custom type declarations that conflict.
If you have specific requirements for JSON-LD script placement, use the `tagPosition` option with `useJsonld`. For example: `useJsonld(data, { tagPosition: 'bodyClose' })`.Change `children: JSON.stringify(jsonLd)` to `innerHTML: JSON.stringify(jsonLd)`.
Ensure you are using `nuxt-jsonld` version 1.5.7 or higher. If the issue persists, review your component structure for accidental multiple `useJsonld` calls or conflicts with other meta management libraries.
Upgrade `nuxt-jsonld` to version 1.5.4 or newer to resolve SSR generation issues. Verify that your JSON-LD data is reactive if it depends on asynchronous data, by passing a function to `useJsonld`.