agentronicsDOCS
Frameworks

Plain HTML / CDN

Add browser-agent authentication to a static page with one script tag — no bundler required.

Plain HTML / CDN

Agentronics ships an IIFE bundle alongside the ESM and CJS builds, so static sites, server-rendered HTML and prototypes can load it from the CDN without a build step.

Static site? Verify on your CDN too

The script tag authenticates agents that run your page. Crawlers and API agents never do — put the Fetch middleware on your edge (e.g. a Cloudflare Worker) to see them.

One-tag install

<script type="module">
  import { Agentronics } from 'https://cdn.agentronics.dev/sdk/0.6.0/index.js'
 
  const client = Agentronics.init({
    publishableKey: 'agtx_pk_live_…',
    siteId: 'shop-acme-com',
  })
 
  const agent = await client.detect()
  if (agent) console.log(`agent on the page: ${agent.class} (${agent.trust})`)
</script>

The CDN serves the same artifact as npm install @agentronics/sdk. Pin a version in production.

Lite path for WebMCP-only sites

For WebMCP detection with the smallest footprint (≤ 8 KB brotli):

<script type="module">
  import { init, detectWebMcp } from 'https://cdn.agentronics.dev/sdk/0.6.0/lite.js'
 
  init({ publishableKey: 'agtx_pk_live_…', siteId: 'shop-acme-com' })
  const agent = await detectWebMcp()
</script>

Classic <script> (no module)

<script src="https://cdn.agentronics.dev/sdk/0.6.0/index.global.js"></script>
<script>
  const client = window.Agentronics.init({
    publishableKey: 'agtx_pk_live_…',
    siteId: 'shop-acme-com',
  })
</script>

window.Agentronics has the same API as the ESM build — see WebMCP & browser agents for detect(), authenticate() and presentIdentity().

Subresource Integrity

For locked-down deployments, pin the SRI hash from https://cdn.agentronics.dev/sdk/0.6.0/index.js.integrity:

<script
  type="module"
  src="https://cdn.agentronics.dev/sdk/0.6.0/index.js"
  integrity="sha384-…"
  crossorigin="anonymous"
></script>

npm vs. CDN

npm installCDN
Tree-shaking✅⚠️ full bundle ships
Source maps✅✅ .map served alongside
Type checking✅ .d.ts❌
Offline development✅❌

Runtime behaviour is identical; switching to npm install @agentronics/sdk later is a one-line change.

On this page