Registry / web-framework / nuxt-schema-org

nuxt-schema-org

JSON →
library6.0.4jsnpmunverified

Nuxt Schema.org is a Nuxt module designed to streamline the generation of Schema.org JSON-LD graphs within Nuxt applications, enhancing search engine rich result visibility. The package is currently at version 6.0.4 and demonstrates an active release cadence with frequent bug fixes and major version updates introducing new features and performance improvements. Key differentiators include a simplified API adhering to Google and Yoast best practices, support for over 30 Schema.org nodes with automated relations, date/URL resolving, and minimal boilerplate for global meta. It is optimized for tree-shaking and server-side rendering (SSR), and integrates with Nuxt Dev Tools, positioning it as a core component of the broader Nuxt SEO ecosystem. It relies on Nuxt 3 and its composable architecture.

npm install nuxt-schema-org
INSTALL
IMPORT
SIG · NUXT-SCHEMA-ORG
N
nuxt-schema-org
web-frameworkjavascriptv6.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

defineNuxtConfig
import { defineNuxtConfig } from 'nuxt'
const defineNuxtConfig = require('nuxt').defineNuxtConfig
Used for configuring the Nuxt module in nuxt.config.ts. Nuxt 3 projects primarily use ESM.
useSchemaOrg
import { useSchemaOrg } from '#imports'
import { useSchemaOrg } from 'nuxt-schema-org'
This is a Nuxt composable; always import from '#imports' within Nuxt components or plugins for correct auto-import resolution.
defineWebSite
import { defineWebSite } from '#imports'
import { defineWebSite } from 'nuxt-schema-org'
Schema node definitions are composables and should be imported from '#imports'.
SchemaOrgOrganization
import { SchemaOrgOrganization } from '#imports'
import { SchemaOrgOrganization } from 'nuxt-schema-org'
Schema node definitions can also be imported as components from '#imports' for use directly in templates.

This quickstart demonstrates how to install `nuxt-schema-org`, configure it in `nuxt.config.ts` with a `host`, and then use `useSchemaOrg` within a Vue component to define `WebSite`, `WebPage`, and `Organization` schema nodes. It highlights the use of composables imported from `#imports`.

/* nuxt.config.ts */ import { defineNuxtConfig } from 'nuxt'; export default defineNuxtConfig({ modules: [ 'nuxt-schema-org' // Add the module to your Nuxt configuration ], schemaOrg: { host: 'https://your-domain.com' // Crucial for generating correct '@id' URLs } }); /* pages/index.vue */ <template> <div> <h1>Welcome to My Awesome Nuxt App</h1> <p>We generate powerful Schema.org data for SEO.</p> </div> </template> <script setup lang="ts"> import { useSchemaOrg, defineWebSite, defineWebPage, defineOrganization } from '#imports'; // Define multiple Schema.org nodes for the current page useSchemaOrg([ defineWebSite({ name: 'My Awesome Nuxt Site', url: 'https://your-domain.com', description: 'A comprehensive website built with Nuxt.', inLanguage: 'en-US' }), defineWebPage({ name: 'Homepage', url: 'https://your-domain.com/', description: 'The main landing page of our Nuxt application.' }), defineOrganization({ name: 'Nuxt Solutions Inc.', url: 'https://your-domain.com', logo: 'https://your-domain.com/logo.png', sameAs: [ 'https://twitter.com/nuxt_solutions', 'https://linkedin.com/company/nuxt-solutions' ] }) ]); // You can also add schema directly in your template using components // <template> // <SchemaOrgProduct name="My Product" description="A great product" /> // </template> </script>
Debug
Known issues
breakingVersion 6.0.0 introduced a major update to 'Nuxt Site Config' (v4.0.0), an internal dependency. While this may not directly impact your site's code, it's recommended to review the breaking changes within the 'nuxt-site-config' package documentation to ensure compatibility, especially if you have custom site configuration logic.
fix
Review the 'Nuxt Site Config' v4.0.0 release notes. Update any custom site configuration logic that might be affected by the changes in site config properties or behavior.
affects: >=6.0.0
Errors
Common errors & fixes
SSR memory leaks observed when generating Schema.org graphs.
Older versions of nuxt-schema-org had issues with SSR memory management.
fix
Upgrade to nuxt-schema-org version 6.0.0 or higher, as this issue was specifically addressed and resolved in this major release.
Incorrect or incomplete '@id' URL generation within Schema.org output.
Prior to v6.0.0, there were known issues with how '@id' URLs were resolved and generated, especially in complex scenarios.
fix
Ensure you are running nuxt-schema-org v6.0.0 or later. Additionally, always explicitly set the `host` property in your `schemaOrg` configuration within `nuxt.config.ts` (e.g., `host: 'https://your-domain.com'`).
Schema.org JSON-LD not appearing in the page's HTML output.
The `nuxt-schema-org` module is not correctly registered or enabled in your Nuxt project.
fix
Verify that `nuxt-schema-org` is included in the `modules` array of your `nuxt.config.ts` file: `modules: ['nuxt-schema-org']`.
Upgrade
Version history
6.0.4latest on npm
Audit
Dependencies
@unhead/vuerequiredUsed for managing document head tags, where Schema.org JSON-LD is injected.
unheadrequiredCore head management library used by Nuxt and @unhead/vue.
zodoptionalOptional peer dependency for content schema validation and augmentation.
Agent activity
2 hits · last 30 days
node
2
Resources
nuxt-schema-org — npm install nuxt-schema-org · libregistry