Using Organization Schema allows you to structure information about companies, organizations, non-profit organizations, etc., so that AI models and search engines can better understand them.
Configure it as a global schema in nuxt.config.ts to automatically inject it into all pages:
// 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
description: 'A company developing Nuxt modules for AI Engine Optimization',
renderHtml: true, // Generate semantic HTML
visuallyHidden: true, // Visually hide
},
],
autoInject: true,
},
})
To add Organization Schema only on specific pages, use the useSchema() composable:
Note:
useSchema()automatically normalizes URLs:
- Absolute URLs (starting with
http://orhttps://) are used as-is- Relative URLs are combined with the base URL (from
useRequestURL()orapp.baseURL)- URL normalization applies recursively to nested objects and arrays (e.g.,
sameAs[],logo.url)- Processes
url,image,logo, anditemproperties throughout the schema
<script setup lang="ts">
useSchema({
context: 'https://schema.org',
type: 'Organization',
name: 'Example Company',
url: '/', // Relative URL - will be normalized to absolute
logo: '/images/logo.png', // Relative URL - will be normalized to absolute
description: 'Example Company provides the best services.',
sameAs: [
'https://github.com/example', // Absolute URL - used as-is
'/social/twitter', // Relative URL - will be normalized to absolute
],
renderHtml: true, // Generate semantic HTML
visuallyHidden: true, // Visually hide
})
</script>
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-aeo'],
aeo: {
schemas: [
{
type: 'Organization',
name: 'Nuxt AEO Project',
url: '/', // Relative URL - will be normalized to absolute
description: 'AI Engine Optimization module for Nuxt',
logo: '/images/logo.png', // Relative URL - will be normalized to absolute
// Social media links
sameAs: [
'https://github.com/your-org/nuxt-aeo', // Absolute URL - used as-is
'/social/twitter', // Relative URL - will be normalized to absolute
'https://linkedin.com/company/your-org', // Absolute URL - used as-is
],
// Contact information
contactPoint: {
type: 'ContactPoint',
telephone: '+1-555-123-4567',
contactType: 'Customer Service',
email: 'support@example.com',
},
renderHtml: true,
visuallyHidden: true,
},
],
autoInject: true,
},
})
<script setup lang="ts">
// Organization data with mixed absolute and relative URLs
const organization = {
name: 'Example Company',
url: '/', // Relative URL - will be normalized to absolute
description: 'Example Company provides the best services.',
logo: '/images/logo.png', // Relative URL - will be normalized to absolute
sameAs: [
'https://github.com/example', // Absolute URL - used as-is
'/social/twitter', // Relative URL - will be normalized to absolute
],
contactPoint: {
telephone: '+1-555-123-4567',
contactType: 'Customer Service',
email: 'support@example.com',
},
}
// Add Organization Schema
useSchema({
context: 'https://schema.org',
type: 'Organization',
name: organization.name,
url: organization.url,
description: organization.description,
logo: organization.logo,
sameAs: organization.sameAs,
contactPoint: {
type: 'ContactPoint',
telephone: organization.contactPoint.telephone,
contactType: organization.contactPoint.contactType,
email: organization.contactPoint.email,
},
renderHtml: true,
visuallyHidden: true,
})
</script>
The above example automatically adds the following JSON-LD script to the page <head>:
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Company",
"url": "https://example.com",
"description": "Example Company provides the best services.",
"logo": "https://example.com/logo.png",
"sameAs": [
"https://github.com/example",
"https://twitter.com/example"
],
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-123-4567",
"contactType": "Customer Service",
"email": "support@example.com"
}
}
When using the renderHtml: true option, the following semantic HTML is automatically generated and injected into the page:
<div class="nuxt-aeo-semantic-organization nuxt-aeo-visually-hidden" aria-hidden="true">
<div itemscope itemtype="https://schema.org/Organization">
<span itemprop="name">Example Company</span>
<span itemprop="description">Example Company provides the best services.</span>
<a itemprop="url" href="https://example.com">https://example.com</a>
</div>
</div>
name: Organization nameurl: Organization website URLdescription: Description of the organizationlogo: Organization logo image URLsameAs: Array of social media profile linkscontactPoint: Contact informationOrganization Schema supports many more properties. For details, refer to the Schema.org Organization documentation.
<script type="application/ld+json"> tag in the Elements tabnuxt-aeo-semantic-organization class is injected inside the body tagOr you can run the following command in the Developer Tools console:
// Check semantic HTML
document.querySelectorAll('.nuxt-aeo-semantic-organization').forEach(el => {
console.log('✅ Organization semantic HTML:', el.innerHTML)
})
// Check JSON-LD schema
document.querySelectorAll('script[type="application/ld+json"]').forEach(script => {
const schema = JSON.parse(script.innerHTML)
if (schema['@type'] === 'Organization') {
console.log('✅ Organization JSON-LD:', schema)
}
})
context and type are automatically converted to @context and @type internallyrenderHtml: true option provides both JSON-LD and semantic HTML together to further optimize LLM crawlingThis page includes FAQPage Schema to help AI models and search engines understand common questions about this topic.
<script setup lang="ts">
useSchemaFaq({
mainEntity: [
{
name: 'When should I use Organization Schema?',
acceptedAnswer: {
text: 'Organization Schema is used to structure information about companies, organizations, non-profit organizations, etc. It can be used on company introduction pages, team pages, contact pages, and more. It helps AI models and search engines better understand organization information and may appear in Google Knowledge Graph.',
},
},
{
name: 'What are the required properties?',
acceptedAnswer: {
text: 'The required properties of Organization Schema are name (organization name) and url (organization website URL). These two properties must be included. Properties like description, logo, sameAs, and contactPoint are recommended and can provide richer information.',
},
},
{
name: 'How do I configure contactPoint?',
acceptedAnswer: {
text: 'contactPoint is configured as an object of type ContactPoint. It can include properties such as telephone (phone number), contactType (contact type, e.g., "Customer Service"), and email. To provide multiple contact points, you can set it as an array.',
},
},
{
name: 'What is the sameAs property?',
acceptedAnswer: {
text: 'The sameAs property represents the organization\'s social media profiles or links to other websites as an array. For example, you can include profile URLs for GitHub, Twitter, LinkedIn, etc. This allows you to connect the organization\'s various online presences.',
},
},
],
})
</script>