Skip to main content

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.
Schemas are client-injected, not in the raw HTML source. For schemas in HTML source, use the Next.js SDK or another server-side method.

Add the snippet

Paste this into the <head> on every page of your site, replacing YOUR_PROJECT_ID:
<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.