Skip to content

Configuration

Configure the module with the jsonLd key in nuxt.config.ts:

ts
export default defineNuxtConfig({
  modules: ['@avensio/nuxt-jsonld'],
  jsonLd: {
    types: ['core'],
    objects: ['global.website'],
    bundles: ['global'],
  },
})

Options

OptionTypeDefaultDescription
typesstring[][]Select type presets whose classes and creators are auto-imported.
objectsstring[][]Register object presets application-wide.
bundlesstring[][]Register every object from the selected bundles application-wide.

Public package entries

Use the dedicated entries for Schema.org helpers:

ts
import { createPerson } from '@avensio/nuxt-jsonld/creators'
import type { Person } from '@avensio/nuxt-jsonld/classes'

The module re-exports creators, class types, and granular class validators from @avensio/jsonld-schema. Import a validator with a path such as @avensio/nuxt-jsonld/validation/classes/Person.validator.

Built with VitePress – Released under the MIT License.