Skip to content

Configuration

interface SchemaGraphOptions {
onError?: 'throw' | 'warn' | 'silent';
baseUrl?: string;
}
Option Default Description
onError throw for build, warn otherwise Global builder validation behavior.
baseUrl Astro site Canonical origin for relative identifiers and URLs.
schemaGraph({
onError: 'throw',
baseUrl: 'https://example.com',
})

Every builder accepts an optional second argument:

interface ValidationOptions {
entityType?: string;
onError?: 'throw' | 'warn' | 'silent';
}

onError overrides the integration setting. entityType is mainly useful with low-level validation or custom builders; built-in builders already set it.

interface GraphOptions {
graph?: boolean; // default: true
context?: string; // default: https://schema.org
baseUrl?: string;
}

These options are accepted by buildJsonLdGraph() and mirror the corresponding <Schema /> props.

interface SerializeOptions {
pretty?: boolean; // default: false
indent?: number; // default: 2
}

getGlobalConfig(), setGlobalConfig(), and resetGlobalConfig() are exported for tooling and tests. Application code should normally configure behavior through schemaGraph() rather than mutating the module-level configuration directly.

Setting Highest to lowest priority
Validation severity builder call → integration → throw
Base URL while rendering component prop → Astro.site → integration
Entity language existing entity value → component prop → Astro.currentLocale