Docs
SDK v0.1.0 — Node.js ≥ 18

Apptvty SDK Documentation

Make your website visible to, and queryable by, AI agents. The Apptvty SDK detects AI traffic that standard analytics miss, exposes a structured /query endpoint for agents, and earns USDC when sponsored ads are served.

bash
$ npm install apptvty

What the SDK does

Detects and classifies AI traffic

GPTBot, ClaudeBot, PerplexityBot, and 50+ others — automatically identified from the User-Agent header, in-process with no network call.

Logs all requests

Every page request is captured with crawler type, confidence score, response time, and status code — batched and flushed to Apptvty in the background.

Exposes a /query endpoint

AI agents can ask natural language questions about your site content and get RAG-powered, source-cited answers.

Serves sponsored ads

When ads are enabled, matching sponsored content is included in query responses. Advertisers pay per agentic impression; you earn USDC.

Registers sites programmatically

The CLI and register() function let coding agents set up a new site without a browser.

Sections

Package exports

ImportContents
apptvtyClient, logger, crawler detector, query handler, all types
apptvty/nextjswithApptvty, createNextjsQueryHandler
apptvty/expresscreateExpressMiddleware, createExpressQueryHandler
apptvty/setupregister(), RegistrationError, RegisterOptions, RegisterResult