---
title: "Install Unhead Schema.org"
description: "Add Schema.org structured data to Angular apps with @unhead/schema-org and the Angular Unhead provider."
canonical_url: "https://unhead.unjs.io/docs/angular/schema-org/guides/get-started/installation"
last_updated: "2026-07-29T15:00:00.376Z"
---

## Setup

### 1. Install the Package

Install `@unhead/schema-org` in your project:

<code-group>

```bash [yarn]
yarn add @unhead/schema-org
```

```bash [npm]
npm install @unhead/schema-org
```

```bash [pnpm]
pnpm add @unhead/schema-org
```

</code-group>

### 2. Configure the Schema.org Plugin

At a minimum, provide a [`host`](/docs/schema-org/guides/core-concepts/params):

```ts [src/app/app.config.client.ts]
import { provideClientHead } from '@unhead/angular/client'
import { UnheadSchemaOrg } from '@unhead/schema-org'

export const appConfig = {
  providers: [
    provideClientHead({
      plugins: [
        UnheadSchemaOrg({ host: 'https://example.com' }),
      ],
    }),
  ],
}
```

Pass the same plugin to `provideServerHead()` when using SSR. See [Schema.org Params](/docs/schema-org/guides/core-concepts/params) for the available configuration.

### 3. Add Site Schema.org

```ts
import { Component, DestroyRef, inject } from '@angular/core'
import { RouterOutlet } from '@angular/router'
import { useUnhead } from '@unhead/angular'
import { defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'

@Component({
  selector: 'app-root',
  imports: [RouterOutlet],
  template: '<router-outlet />',
})
export class AppComponent {
  private head = useUnhead()
  private destroyRef = inject(DestroyRef)

  constructor() {
    const entry = useSchemaOrg(this.head, [
      defineWebSite({ name: 'Example Site' }),
      defineWebPage(),
    ])

    this.destroyRef.onDestroy(() => entry.dispose())
  }
}
```

The framework-agnostic `useSchemaOrg()` function takes the Unhead instance as its first argument. Register its returned entry with `DestroyRef` so component-scoped schema is removed during cleanup.

## Recommended: Vite Plugin

With Vite, the [Unhead plugin](/docs/head/guides/build-plugins/overview) can tree-shake server-only code and transform head composables at build time.

## Next Steps

1. Choose an [Identity](/docs/schema-org/guides/recipes/identity)
2. Set up your pages with [Schema.org Params](/docs/schema-org/guides/core-concepts/params)
3. Follow a recipe:

- [Breadcrumbs](/docs/schema-org/guides/recipes/breadcrumbs)
- [FAQ Page](/docs/schema-org/guides/recipes/faq)
- [Site Search](/docs/schema-org/guides/recipes/site-search)
