Introduction

Providing an identify will be link the Default Schema.org to the author of the site and for Organization or LocalBusiness nodes may help with Rich Results.

Schema.org Identity

Choosing an Identity

Your choices fore identity are:

Person

A Person identity should be used when your website is about a person, a personal brand or a personal blog.

Example: harlanzw.com, antfu.me

import { definePerson } from 'nuxt-schema-org/schema'

export default defineNuxtConfig({
  schemaOrg: {
    identity: definePerson({
      name: 'Harlan Wilton',

      // Profile Information, if applicable
      image: '/profile-photo.jpg',
      description: 'Software engineer and open-source contributor',

      url: 'harlanzw.com',
      sameAs: [
        'https://twitter.com/harlan_zw',
        'https://github.com/harlan-zw'
      ],
    })
  }
})

Organization

The Organization identity should be used when your website is about a company, a brand, a non-profit or a community. However, it should also be used as the catch-all identity when the other options don't fit.

import { defineOrganization } from 'nuxt-schema-org/schema'

export default defineNuxtConfig({
  schemaOrg: {
    identity: defineOrganization({
      // Basic Information
      name: 'TechCorp Solutions',
      logo: '/logo.png',
    })
  }
})

LocalBusiness

The LocalBusiness identity should be used when your website is about a local business, a store, a restaurant or a service. It must have a physical address associated with it.

Some examples of LocalBusiness{lang="ts}: : Restaurant, HealthAndBeautyBusiness, ProfessionalService, FinancialService, MedicalBusiness, etc...

Google recommends using the most specific type of LocalBusiness that fits your business, check the list of subtypes to find the most appropriate.

If you need to use dynamic data, you can use the defineLocalBusiness function to define the identity within your app.vue.

import { defineLocalBusiness } from 'nuxt-schema-org/schema'

export default defineNuxtConfig({
  schemaOrg: {
    identity: defineLocalBusiness({
      '@type': '...', // Choose from https://schema.org/LocalBusiness#subtypes

      // Basic Information (Required)
      'name': 'The Coastal Kitchen',
      'description': 'Farm-to-table restaurant specializing in sustainable seafood and seasonal ingredients',
      'url': 'https://thecoastalkitchen.com',

      // Location (Required)
      'address': {
        streetAddress: '742 Oceanview Boulevard, Suite 100',
        addressLocality: 'Santa Cruz',
        addressRegion: 'CA',
        postalCode: '95060',
        addressCountry: 'US'
      },
    }),
  }
})

OnlineStore

The OnlineStore identity should be used for ecommerce sites.

import { defineOrganization } from 'nuxt-schema-org/schema'

export default defineNuxtConfig({
  schemaOrg: {
    identity: defineOrganization({
      '@type': ['Organization', 'Store', 'OnlineStore'],

      // Basic Information
      'name': 'ModernHome',
      'logo': '/logo.png',
    }),
  }
})

Recipes

It's recommended to provide as much information about your identity as possible, here are some recipes.

Social Media Profiles

Organization
// example for nuxt.com
export default defineNuxtConfig({
  schemaOrg: {
    identity: {
      type: 'Organization',
      name: 'NuxtJS',
      logo: '/logo.png', // will resolve to canonical URL + /logo.png
      sameAs: [
        'https://x.com/nuxt_js',
        'https://www.linkedin.com/showcase/nuxt-framework/',
        'https://github.com/nuxt'
      ]
    }
  }
})
Person
// example for harlanzw.com
export default defineNuxtConfig({
  schemaOrg: {
    identity: {
      type: 'Person',
      name: 'Harlan Wilton',
      image: '/profile.jpg',
      sameAs: [
        'https://x.com/harlan_zw',
        'https://github.com/harlan-zw',
        'https://harlanzw.com'
      ]
    }
  }
})
LocalBusiness
// local coffee shop
export default defineNuxtConfig({
  schemaOrg: {
    identity: {
      type: 'LocalBusiness',
      name: 'Coffee Shop',
      logo: '/logo.png', // will resolve to canonical URL + /logo.png
      sameAs: [
        'https://x.com/coffee_shop',
        'https://www.facebook.com/coffee_shop',
        'https://www.yelp.com/coffee_shop'
      ]
    }
  }
})
Did this page help you?