> ## Documentation Index
> Fetch the complete documentation index at: https://docs.instantschema.app/llms.txt
> Use this file to discover all available pages before exploring further.

# CDN Script

> Add InstantSchema to any site with a single script tag

# CDN Script

The fastest integration — paste one tag into your `<head>` and the hosted loader handles the rest. Schemas are fetched and injected by JavaScript after the page loads.

<Note>
  Schemas are **client-injected**, not in the raw HTML source. Google indexes them after executing JavaScript (typically a few seconds after the page loads). For schemas in HTML source, use the [Next.js SDK](/integrations/nextjs) or another server-side method.
</Note>

## Add the tag

Paste this into the `<head>` on every page of your site:

```html theme={null}
<script
  src="https://app.instantschema.com/v1/loader.js"
  data-project-id="YOUR_PROJECT_ID"
  async
></script>
```

Replace `YOUR_PROJECT_ID` with the Project ID from your [InstantSchema dashboard](https://app.instantschema.com).

## Attributes

| Attribute         | Required    | Description                                                      |
| ----------------- | ----------- | ---------------------------------------------------------------- |
| `data-project-id` | Yes         | Your InstantSchema project ID                                    |
| `data-api-url`    | No          | Override API base URL (default: `https://app.instantschema.com`) |
| `async`           | Recommended | Non-blocking load; doesn't delay page rendering                  |

## How it works

The loader reads `data-project-id` and `window.location.pathname`, calls `/api/v1/structured-data`, then appends each schema as a `<script type="application/ld+json">` tag to `<document.head>`.

## Detection

The dashboard detects the CDN script by scanning your site's HTML source for the loader tag. Once the tag is live, the integration panel will show **Integration active · via CDN script** (the panel polls every 8 seconds while unconfirmed).
