Keep your existing Schema.org fields and add mosaicora:og semantic values for content the generator should render exactly. These overrides guide the Open Graph image; they do not replace normal page metadata.
serializeJsonLd removes undefined values and escapes less-than characters so the result can be embedded in an HTML JSON-LD script element.
Build and serialize the override
import {
buildMosaicoraOgJsonLd,
serializeJsonLd,
} from "@mosaicora/plugin-mosaicora-core";
const jsonLd = buildMosaicoraOgJsonLd({
schemaType: "Product",
name: "Example product",
offers: {
"@type": "Offer",
price: "49",
priceCurrency: "USD",
},
mosaicoraOg: {
schemaVersion: 3,
semanticValues: {
"content.title": "Example product",
"content.description": "A polished product preview.",
"product.price": "$49",
"product.features": ["Fast setup", "Consistent previews"],
},
},
});
const serialized = serializeJsonLd(jsonLd);
Embed with your template engine
Insert serialized as the text content of an application/ld+json script.
<script type="application/ld+json">
SERIALIZED_JSON_LD
</script>