Recipes

Custom Nodes

Learn how to implement custom nodes for your Schema.org.

If you need to add a node that isn't officially implemented, then you can provide it yourself.

Custom nodes are just plain objects that follow the Schema.org specification.

useSchemaOrg([
  {
    '@type': 'SingleFamilyResidence',
    'numberOfRooms': 3,
    'occupancy': 5,
    'numberOfBathroomsTotal': 2,
    'floorSize': '2000 sqft',
    'petsAllowed': true,
  }
])

Using Schema-dts

If you'd like to add full TypeScript support, you can use schema-dts.

import type { DefinedTerm } from 'schema-dts'

useSchemaOrg([
  <DefinedTerm> {
    '@type': 'DefinedTerm',
    'name': 'Nuxt Schema.org',
    'description': 'Nuxt Schema.org is a Nuxt module for adding Schema.org to your Nuxt app.',
    'inDefinedTermSet': {
      '@type': 'DefinedTermSet',
      'name': 'Nuxt Modules',
    },
  }
])