User Config

Change the behaviour of your integration.


Note that these options may be provided differently depending on your integration.

client

  • type: boolean
  • default: Enabled in dev or Non-SSR environments

Enables the client side rendering of the Schema.org client.

When disabled will replace all references to composables and components with mocks, providing a 0kb runtime.

Notes:

  • This should be enabled for SPA builds

full

  • type: boolean
  • default: false

When building a complex Schema, you may come across certain limitations with the packages simple types.

To switch to using schema-dts types, set full to true.

When set to false the "simple" types are used which provide light-weight types which adhere to best practices from Google.

Notes:

  • You may need to clear your working build directory once you switch, as the auto-imports will need to be updated.
  • This requires using auto-imports

canonicalHost

  • type: string
  • default: window.location.origin

The production URL of your site. This allows the client to generate all URLs for you and is important to set correctly.

defaultLanguage

  • type: string
  • default: en

Will set the isLanguage to this value for any Schema which uses it. Should be a valid language code, i.e en-AU

defaultCurrency

  • defaultCurrency: string
    • default: undefined

    Will set the priceCurrency for Product Offer Schema. Should be a valid currency code, i.e AUD

Types

interface UserConfig {  /**   * Should schema.org only be rendered by the server.   *   * Useful for optimising performance as it may not be needed by search engines. Changes runtime package size to 0kb.   *   * @default false   */  client?: boolean;  /**   * Should full schema types from `schema-dts` be used over a simplified version.   *   * @default false   */  full?: boolean;  /**   * Extra default metadata for the schema.org generation, you can use this as an alternative to the other meta.   */  meta?: BaseMetaInput;  /**   * The production URL of your site. This allows the client to generate all URLs for you and is important to set correctly.   */  canonicalHost?: `https://${string}`;  /**   * Will set the `isLanguage` to this value for any Schema which uses it. Should be a valid language code, i.e `en-AU`   */  defaultLanguage?: string;  /**   * Will set the `priceCurrency` for [Product](/schema/product) Offer Schema. Should be a valid currency code, i.e `AUD`   */  defaultCurrency?: string;  /**   * @deprecated You can remove this option, it doesn't do anything now.   */  debug?: boolean;}