Module Options

Learn about the configuration options for the Nuxt AEO module

You can configure the Nuxt AEO module options in nuxt.config.ts.

Basic Configuration

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    // Module options
  },
})

Option List

schemas

An array of schemas to inject globally. Configured schemas are automatically injected into all pages.

Type: GlobalSchema[]:brDefault: undefined

Description:

  • If schemas array is missing or empty, a default Project schema is injected
  • You can configure various schema types like Person, Organization, WebSite, etc.
  • Using context and type will automatically convert them to @context and @type internally
  • Route-Specific Schemas: You can configure schemas to be applied only to specific routes by setting the url field
    • If url is not specified, the schema is applied to all routes (backward compatibility)
    • If url is specified, the schema is only applied when the current route path matches exactly
    • Both relative paths (/, /introduction) and absolute URLs (https://www.example.com/about) are supported
    • Paths are normalized (trailing slashes are removed) for comparison

Note: If the schemas array is missing or empty, a default Project schema is automatically injected.

Example:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    schemas: [
      {
        type: 'Organization',
        name: 'My Company',
        url: '/', // Relative URL - will be normalized to absolute
        logo: '/images/logo.png', // Relative URL - will be normalized to absolute
      },
      {
        type: 'Person',
        name: 'Yeonju Lee',
        alternateName: 'Dewdew',
        jobTitle: 'Software Engineer / CDO',
        url: 'https://www.example.com', // Absolute URL - used as-is
        image: '/images/profile.jpg', // Relative URL - will be normalized to absolute
        knowsAbout: ['Nuxt3', 'TypeScript', 'Supabase'],
        sameAs: [
          'https://github.com/dewdew', // Absolute URL - used as-is
          '/social/twitter', // Relative URL - will be normalized to absolute
        ],
      },
      {
        type: 'WebSite',
        name: 'My Website',
        url: 'https://www.example.com', // Absolute URL - used as-is
        description: 'My awesome website',
      },
    ],
  },
})

Route-Specific Schema Example:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    schemas: [
      {
        type: 'WebSite',
        name: 'Portfolio',
        description: 'Portfolio is a website of Software Engineer.',
        url: '/', // Only applied to root route (/)
        logo: '/images/logo.png',
      },
      {
        type: 'Introduction',
        name: 'Introduction',
        description: 'Introduction is a page of Software Engineer.',
        url: '/introduction', // Only applied to /introduction route
        logo: '/images/logo.png',
      },
      {
        type: 'Organization',
        name: 'My Company',
        // No url field - applied to all routes (backward compatibility)
      },
    ],
  },
})

autoInject

Controls whether global schema information is automatically injected.

Type: boolean:brDefault: true

Description:

  • If true: Schemas configured in the schemas array are automatically injected into all pages
  • If false: Even if the schemas array exists, schemas are not injected
  • If the schemas array is missing, a default Project schema is injected (except when autoInject: false)

Example:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    schemas: [
      {
        type: 'Organization',
        name: 'My Company',
      },
    ],
    autoInject: false, // Disable automatic global schema injection
  },
})

renderHtml

Controls whether semantic HTML is automatically generated globally.

Type: boolean:brDefault: true

Description:

  • If true: Semantic HTML is automatically generated for global schemas and injected into pages
  • Semantic HTML is used together with JSON-LD to optimize LLM crawling
  • Can be overridden with the renderHtml option on individual schemas

Example:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    schemas: [
      {
        type: 'Organization',
        name: 'My Company',
        renderHtml: true, // Can be overridden on individual schemas
      },
    ],
    renderHtml: true, // Global default value
  },
})

visuallyHidden

Controls whether semantic HTML is visually hidden globally.

Type: boolean:brDefault: true

Description:

  • If true: Generated semantic HTML is hidden with the visually-hidden class
  • LLM crawlers and search engines can read it, but it's not visible to users
  • Can be overridden with the visuallyHidden option on individual schemas

Example:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    schemas: [
      {
        type: 'Organization',
        name: 'My Company',
        visuallyHidden: false, // Can be overridden on individual schemas
      },
    ],
    visuallyHidden: true, // Global default value
  },
})

Complete Example

nuxt.config.ts
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-aeo'],
  aeo: {
    // Global schema array
    schemas: [
      {
        type: 'Organization',
        name: 'My Company',
        url: '/', // Relative URL - will be normalized to absolute
        logo: '/images/logo.png', // Relative URL - will be normalized to absolute
        renderHtml: true,
        visuallyHidden: true,
      },
      {
        type: 'Person',
        name: 'Yeonju Lee',
        alternateName: 'Dewdew',
        jobTitle: 'Software Engineer / CDO',
        url: 'https://www.example.com', // Absolute URL - used as-is
        image: '/images/profile.jpg', // Relative URL - will be normalized to absolute
        knowsAbout: ['Nuxt3', 'TypeScript', 'Supabase'],
        sameAs: [
          'https://github.com/dewdew', // Absolute URL - used as-is
          '/social/twitter', // Relative URL - will be normalized to absolute
        ],
        renderHtml: true,
        visuallyHidden: true,
      },
      {
        type: 'WebSite',
        name: 'My Website',
        url: 'https://www.example.com', // Absolute URL - used as-is
        description: 'My awesome website',
      },
    ],
    // Automatic injection
    autoInject: true,
    // Global semantic HTML auto-generation
    renderHtml: true,
    // Global visual hiding
    visuallyHidden: true,
  },
})

Frequently Asked Questions

This page includes FAQPage Schema to help AI models and search engines understand common questions about module options configuration.

pages/example.vue
<script setup lang="ts">
useSchemaFaq({
  mainEntity: [
    {
      name: 'Is global schema configuration required?',
      acceptedAnswer: {
        text: 'No, it is not required. If the schemas array is missing or empty, a default Project Schema will be automatically injected. However, if you configure schemas like Organization, Person, or WebSite globally, they will be automatically applied to all pages.',
      },
    },
    {
      name: 'What is the autoInject option?',
      acceptedAnswer: {
        text: 'The autoInject option controls whether global schema information is automatically injected. If true (default), schemas configured in the schemas array are automatically injected into all pages. If set to false, they will not be injected.',
      },
    },
    {
      name: 'What is the difference between renderHtml and visuallyHidden?',
      acceptedAnswer: {
        text: 'renderHtml controls whether semantic HTML is automatically generated, while visuallyHidden controls whether the generated HTML is visually hidden. If renderHtml is true, semantic HTML is generated along with JSON-LD. If visuallyHidden is true (default), it is not visible to users but can be read by LLM crawlers.',
      },
    },
    {
      name: 'Can I override options on individual schemas?',
      acceptedAnswer: {
        text: 'Yes, the renderHtml and visuallyHidden options can be set not only globally but also on individual schemas, allowing you to specify different behavior for specific schemas.',
      },
    },
    {
      name: 'How do route-specific schemas work?',
      acceptedAnswer: {
        text: 'You can configure schemas to be applied only to specific routes by setting the url field in the schema configuration. If url is not specified, the schema is applied to all routes (backward compatibility). If url is specified, the schema is only applied when the current route path matches exactly. Both relative paths and absolute URLs are supported.',
      },
    },
  ],
})
</script>

Question List

  • Is global schema configuration required?: Not required; if not configured, a default Project Schema will be automatically injected
  • What is the autoInject option?: An option that controls whether global schemas are automatically injected
  • What is the difference between renderHtml and visuallyHidden?: renderHtml controls semantic HTML generation, while visuallyHidden controls visual hiding of generated HTML
  • Can I override options on individual schemas?: Yes, you can set renderHtml and visuallyHidden separately on individual schemas
  • How do route-specific schemas work?: You can configure schemas to be applied only to specific routes by setting the url field. If url is not specified, the schema is applied to all routes

Next Steps

  • Usage - Adding page-specific schemas
  • Semantic HTML - Detailed explanation of semantic HTML auto-generation feature