Developer Documentation

Make your app agent-ready

One script tag. Any AI agent can now discover, authenticate, and use your app programmatically.

Add to your site
<script src="https://cdn.jsdelivr.net/npm/agentdom@3/agentdom.js"></script>

Quick Start

Three ways to add AgentDOM to your app.

Option 1: CDN Script Tag

Add this before </body> in your HTML:

<!-- AgentDOM v3 — makes your site agent-ready -->
<script src="https://cdn.jsdelivr.net/npm/agentdom@3/agentdom.js"></script>

That's it. Any agent using AgentDOM can now scan and interact with your page.

Embed & Configure

Customize AgentDOM for your specific app.

Agent Manifest (/agentdom.json)

Place this at your site root to tell agents what your app offers:

agentdom.json
{
  "agentdom": "3.0.0",
  "name": "Your App",
  "description": "What your app does",
  "auth": {
    "methods": ["form", "oauth2"],
    "login_url": "/login"
  },
  "capabilities": [
    { "name": "search", "url": "/search" }
  ]
}

Annotate Your Forms

Add data-agentdom-* attributes so agents understand your forms:

<form data-agentdom-intent="authenticate">
  <input name="email" type="email"
         data-agentdom-field="email">
  <input name="password" type="password"
         data-agentdom-field="password">
  <button type="submit">Log In</button>
</form>

<!-- Agent auto-generates: login(email, password) -->

Agent Authentication

Let agents authenticate with your service securely.

Form-Based Auth

Agent fills your login form directly. No API changes needed.

login(email: "user@co.com",
      password: "agent-token")

// AgentDOM fills + submits

OAuth2 for Agents

Standard OAuth2 flow with agent-specific scopes.

"auth": {
  "methods": ["oauth2"],
  "oauth2": {
    "authorize_url": "/oauth/authorize"
  }
}

API Key Auth

Issue agent-specific API keys with limited scopes.

<input name="api_key"
       data-agentdom-field="api_key">

Agent Tokens

Short-lived tokens for agent sessions.

POST /auth/agent-token
{ "agent_id": "agentdom-v3",
  "scopes": ["read"], "ttl": 3600 }

Dynamic Tool Generation

Your page's forms and buttons automatically become callable tools.

Your Page HasAgent GetsExample
Login formlogin(email, password)Gmail, Stripe
Search barsearch(query)Google, Amazon
Signup formcreate_account(name, email, pwd)Any registration
Checkout formcheckout(card, exp, cvc)Stripe, Shopify
Nav linksnavigate_to(destination)Dashboard
Buttonssubscribe(), download()SaaS apps

API Reference

JavaScript API available on any page with AgentDOM.

Schema & Discovery

AgentDOM.scan()

Returns structured JSON schema of all forms, buttons, and links.

AgentDOM.scanWithTools()

Scan + auto-generate tools. Returns schema with tools array.

AgentDOM.synthesizeTools(schema?)

Generate tools from a schema. Returns { tools, page_type, summary }.

Actions

AgentDOM.click(selector)

Human-like click with bezier mouse path.

AgentDOM.type(selector, text)

Type with realistic keystroke timing. React-compatible.

AgentDOM.fillForm(selector, data)

Fill entire form from { fieldName: value } object.

AgentDOM.submitForm(selector)

Find and click the submit button.

AgentDOM.hover(selector, duration?)

Hover with pointer events. Triggers tooltips and dropdowns.

Server-Side Integration

ProtocolEndpointUse Case
HTTP APIPOST /tools/discoverScan URL → get tools
HTTP APIPOST /tools/executeExecute a tool
MCPtools/listClaude / Cursor
OpenAIFunction CallingTools per turn
GeminiFunction CallingTools per turn
A2A/.well-known/agent.jsonAgent Card