Configuration
Integration options
Section titled “Integration options”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',})Per-builder options
Section titled “Per-builder options”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.
Graph options
Section titled “Graph options”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.
Serialization options
Section titled “Serialization options”interface SerializeOptions { pretty?: boolean; // default: false indent?: number; // default: 2}Global configuration helpers
Section titled “Global configuration helpers”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.
Resolution precedence
Section titled “Resolution precedence”| 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 |