Skip to content

Organization builder

Creates an Organization for publishers, providers, and brands. The Organization builder injects @type, validates synchronously, and rejects unknown properties.

// Astro — shown first when Astro is selected
import { Organization } from '@unschema-graph/astro';
// Svelte 5
import { Organization } from '@unschema-graph/svelte';
// Core / Node.js
import { Organization } from '@unschema-graph/core';
import { OrganizationSchema } from '@unschema-graph/core';

The OrganizationSchema Zod schema is also exported for composition and advanced validation.

import {
OrganizationSchema,
type SchemaInput,
type SchemaOutput,
} from '@unschema-graph/core';
type OrganizationInput = SchemaInput<typeof OrganizationSchema>;
type OrganizationOutput = SchemaOutput<typeof OrganizationSchema, 'Organization'>;
Property Input type Required Default / constraints
@id string No —
name string Yes non-empty
legalName string No —
url string No —
logo string | ImageObject No non-empty
image string | ImageObject No non-empty
description string No —
sameAs string | Array No —
address string | PostalAddress | EntityReference No —
contactPoint ContactPoint | Array<ContactPoint> No —
email string No format: email
telephone string No —
foundingDate string | number | Date No non-empty

The aliases above remain the exact authority for nested object types. The builder also accepts a validation configuration as its second argument and always returns @type: 'Organization'.

import { Organization } from '@unschema-graph/core';
const entity = Organization({
"name": "Acme",
"url": "https://example.com"
});
{
"@type": "Organization",
"name": "Acme",
"url": "https://example.com"
}
  • Passing an unknown property to the strict builder.
  • Using source data that is missing a required property.
  • Assuming valid Schema.org guarantees a search appearance.

Use Organization.safeParse(input) for external data. If Schema.org supports a property that is not modeled yet, validate the entity first and then use withAdditionalProperties(). Never pass invented properties to the strict builder.