/license.xml, and rewriting the URL. This page focuses on CAP enforcement using the SDK directly.
SDK Setup
botDetector function to extend or override the built-in user-agent heuristics:
Analytics is off by default. Set
analyticsEnabled: true to emit one event per request to Supertab Connect — this is what powers bot classification and traffic reporting in your dashboard. Enforcement is separate: it decides whether unlicensed requests are allowed or blocked.Option A: handleRequest (Recommended)
The handleRequest method handles the full lifecycle — bot detection, token extraction, verification, enforcement, and analytics (when enabled) — in one call. It returns the correct 401/403 response with the WWW-Authenticate and Link headers automatically. Pass an ExecutionContext via the ctx option if your runtime supports background tasks, so event recording never blocks the response.
Option B: Manual Verification
For fine-grained control over responses or custom routing, useverifyAndRecord directly:
WWW-Authenticate and Link headers in the 401 responses follow the CAP specification and tell the crawler where to obtain a license.
Related Docs
Deploy in Your CDN
General deployment guide covering RSL serving, CAP, and robots.txt.
SDK Overview
Full API reference for all SDK methods across languages.