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
| Option | Type | Default | Description |
|---|---|---|---|
types | string[] | [] | Select type presets whose classes and creators are auto-imported. |
objects | string[] | [] | Register object presets application-wide. |
bundles | string[] | [] | 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.