About this project
Known Agents SDK is an official Node.js client for interacting with the Known Agents platform. It enables server‑side TypeScript or JavaScript applications to collect detailed analytics about AI agents and other bots that visit a site or call Model Context Protocol (MCP) endpoints.\n\nKey features:\n\n* **Visit event tracking** – Use `trackPageviewOrRESTCall` in middleware to record pageviews or REST calls. Events are queued and automatically flushed based on size or time interval.\n* **MCP call tracking** – For services built on the Model Context Protocol, `trackMCPCall` records the request, response and transport details, automatically handling Agentic Commerce Protocol (ACP) and Universal Commerce Protocol (UCP) interactions.\n* **Agentic commerce support** – When handling ACP or UCP REST responses, include the response body in `trackPageviewOrRESTCall` to capture purchase‑flow data.\n* **Automatic robots.txt generation** – Call `generateRobotsTXT` with a list of `AgentType` values to obtain a plain‑text robots.txt that blocks or allows specific crawler categories. The string can be regenerated on a schedule (e.g., daily) and served at `/robots.txt`.\n* **Agent Identification API** – Identify and verify incoming requests using `identifyAgent` (single request) or `identifyAgents` (batch). The response includes verification status, agent metadata, ASN information, and an automation score indicating how likely the request is automated.\n\nInstallation is straightforward via npm: `npm install @knownagents/sdk`. After signing up at knownagents.com and obtaining an access token, instantiate the client with `new KnownAgents('YOUR_ACCESS_TOKEN')`. Optional configuration lets you set `flushQueueSize` and `flushIntervalInMilliseconds` for event batching.\n\nThe SDK requires TypeScript ≥ 4.7 and runs on Node.js 18 LTS or newer. For help, open an issue on the GitHub repository.\n\nOverall, the library provides a comprehensive, server‑side solution for AI‑agent analytics, bot traffic management, and automated robots.txt handling, making it easier to monitor and control AI‑driven interactions with your web services.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.