> ## 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.

# Inline Script

> Self-contained IIFE for static and legacy sites

# Inline Script

A self-contained snippet that doesn't depend on an external file. Good for static site generators, legacy CMSes, or any site where you can't add external script tags.

<Note>
  Schemas are **client-injected**, not in the raw HTML source. For schemas in HTML source, use the [Next.js SDK](/integrations/nextjs) or another server-side method.
</Note>

## Add the snippet

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

```html theme={null}
<script>
(function(){
  var p = window.location.pathname;
  fetch('https://app.instantschema.com/api/v1/structured-data?project=YOUR_PROJECT_ID&pathname=' + encodeURIComponent(p))
    .then(function(r) { return r.json(); })
    .then(function(d) {
      (d.schemas || []).forEach(function(s) {
        var el = document.createElement('script');
        el.type = 'application/ld+json';
        el.textContent = JSON.stringify(s);
        document.head.appendChild(el);
      });
    });
})();
</script>
```

## Detection

The dashboard detects the inline script by scanning for the hardcoded fetch URL in your page's HTML source. Keep the fetch URL intact — changing it (e.g. via a variable) will prevent automatic detection.

Once detected, the integration panel shows **Integration active · via inline script**. The panel polls every 8 seconds while unconfirmed.
